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.
- 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)
Errors
An error is never a verdict: do not drop an address because of it.
| Exception | When |
|---|---|
MailTesterKeyError |
The key is invalid or disabled. |
MailTesterRateLimitError |
A limit was reached (HTTP 429). retry_after is set on the free tier. |
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.
Links
- API documentation and OpenAPI 3.1 specification
- Integrations: n8n, Zapier, Make, Clay, Google Sheets
- Code examples for other languages
- JavaScript and TypeScript client
License
MIT
Metadata
Release files for mailtester-ninja 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mailtester_ninja-1.0.0.tar.gz | 7.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mailtester_ninja-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / mailtester_ninja-1.0.0.tar.gz
| Download URL | mailtester_ninja-1.0.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32a94d518c6e689fd4a47cb5f8bacdae1a30eb42c4e5400abd201cff0590a7e7
|
|
BLAKE2b-256 checksum How to use checksums |
f962fa9194ffa0a356d9f7528b8edc9162f136c42225bf46ecbae99a4f663207
|
| 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 26, 2026.
Transparency logRelease files / mailtester_ninja-1.0.0-py3-none-any.whl
| Download URL | mailtester_ninja-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f7c66811aa49feb3f0c46f715418122a5a3bb616fee2a56bdd66463dd016112
|
|
BLAKE2b-256 checksum How to use checksums |
27d5283d51e3c23623e263f1e63249bda69da0f42f4a27f75a14d5ed1e1126bc
|
| 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 26, 2026.
Transparency logSecurity for mailtester-ninja 1.0.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mailtester_ninja-1.0.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 26, 2026.
Transparency logA 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.