Skip to main content

MailTester Ninja for Python

Official client for the MailTester Ninja email verification API. Check in real time whether an email address is valid and deliverable: each address is checked against the recipient's mail server, and nothing is stored. With a paid key, find also looks up a person's work email from their name and company domain.

  • No dependencies (standard library only), typed, Python 3.9+
  • Free to try: no signup with key="free", or a free API token for 50 checks a day
pip install mailtester-ninja

Quickstart

from mailtester_ninja import MailTester

mt = MailTester()  # reads MAILTESTER_KEY, falls back to "free"

result = mt.verify("info@apple.com")
print(result.code, result.message)  # ok Accepted

Reading the verdict

Branch on code, show message to people.

code Meaning Typical message
ok Valid and deliverable Accepted
ko Invalid, will bounce Rejected, No MX, Disposable, Limited
mb Uncertain: catch-all domain, or the server could not be probed Catch-All, MX Error, Timeout, SPAM Block, Greylisted

A catch-all domain is never reported as valid. Shortcuts: result.is_valid, result.is_invalid, result.is_uncertain, and mt.is_deliverable(email).

Verify a list

verify_many checks one address at a time and paces the calls for you: 30 seconds apart on the free tier, 1 second with a paid key (override with delay). Errors are reported per address, the loop keeps going.

for email, result, error in mt.verify_many(["info@apple.com", "someone@example.com"]):
    if error:
        print(email, "no verdict:", error.message)
    else:
        print(email, result.code, result.message)

Find a work email (paid key)

find calls the Finder API: it tests the most common address formats one by one (first.last, flast, first, firstlast, first_last, f.last) and returns the first one the mail server accepts.

r = mt.find("Jean-Pierre", "De La Tour", "example.com")
if r.found:
    print(r.email)             # an address the mail server just accepted
else:
    print(r.message, r.guess)  # e.g. Catch-All and the most common format
print(r.permutations)          # formats tested, each one counted as a verification
print(r.format, r.confidence)  # e.g. flast medium: an initial, a namesake may share it
  • Each format tested counts as one verification against your daily limit, even when nothing is found. The search paces itself within the rate of your key.
  • confidence tells how sure the address is to belong to this person: high when it holds the first and last name, medium with an initial, low with the first name only. tested lists every address checked, with its verdict.
  • On a catch-all domain nothing can be confirmed: found is False and guess holds the most common format.
  • Personal email providers such as gmail.com are not searched (message is Webmail).
  • A free key raises MailTesterKeyError; over the rate of your key, MailTesterRateLimitError carries retry_after.

Errors

An error is never a verdict: do not drop an address because of it.

Exception When
MailTesterKeyError The key is invalid or disabled, or find was called with a free key.
MailTesterRateLimitError A limit was reached (HTTP 429). retry_after is set on the free tier and by find.
MailTesterError Any other HTTP or network error (status when there is one).

Keys and limits

Key Daily checks Pace
free 10 per IP 1 request every 30 s
Free token mtf_... (get one) 50 per token 1 request every 30 s
Paid key sub_... (plans) 100,000 to 200,000+ daily limit / 8640 per 10 s (Pro 11, Ultimate 23)

Options: MailTester(key=None, base_url=..., timeout=60.0). The key defaults to the MAILTESTER_KEY environment variable, then to free.

License

MIT

Metadata

Release files for mailtester-ninja 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailtester-ninja 1.1.0
File Size Uploaded Provenance Actions
mailtester_ninja-1.1.0.tar.gz 9.5 kB With provenance Details for mailtester_ninja-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mailtester-ninja 1.1.0
File Interpreter ABI Platform Actions
mailtester_ninja-1.1.0-py3-none-any.whl Python 3 none any Details for mailtester_ninja-1.1.0-py3-none-any.whl

Total release size: 18.0 kB

Release files / mailtester_ninja-1.1.0.tar.gz

Download URL mailtester_ninja-1.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4a99ade6e9f76ab08161f0616a6dccfdbb0b60d122f7ce50a84b68c3d91c15a9
BLAKE2b-256 checksum
How to use checksums
35c0ecf131a664b89d69e5f3b85dc549b20ed13313e58d094a7d2c12d12d3cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / mailtester_ninja-1.1.0-py3-none-any.whl

Download URL mailtester_ninja-1.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
640809a41610ecebc5d35a7bcc80dce8485afc2ff781b0da4b25e4ab1a26707a
BLAKE2b-256 checksum
How to use checksums
a0085afe95e3b09f8ba75e9b7257c88383df5b51a467702f7ff7a06a2876e48f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for mailtester-ninja 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mailtester_ninja-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page