Python SDK
Full API reference forzerodrop — the ZeroDrop Python SDK.
Installation
ValueError on every email, because they can’t parse its timestamp there.
ZeroDrop class
Parameters
Without an API key, anyone who knows an inbox’s name can read it, one sender can reach only 5 different inboxes a day (past that, the inbox gets a notice from
notice@zerodrop.dev instead of the email), and each inbox expires 30 minutes after its latest email, on a shared domain. With a free key (zerodrop 0.2.0 or later), generate_inbox() starts names with your key’s prefix, only your key can read those inboxes, and mail to them isn’t limited. mail.prefix holds the prefix ("k7x2"), or None without a key.
generate_inbox()
wait_for_latest()
ZeroDropTimeoutError if no email arrives within the timeout, and ZeroDropHeldError at once if ZeroDrop held the email (see Error types).
Parameters
fetch_latest()
None if the inbox is empty or no email matches the filter. Raises ZeroDropHeldError if nothing matches and the inbox holds a notice that ZeroDrop held an email.
Email Filtering
Filter emails by sender, subject, body, or extracted fields. Useful when multiple emails land in the same inbox.ZeroDropEmail type
otp
4-8 digit numeric code extracted from the email body. Detected near labels likecode, otp, pin, verification. None if not detected.
magic_link
Verification or reset URL extracted from the email body. Detected for URLs containingverify, confirm, reset, token, activate, or auth. None if not detected.
ZeroDropFilter type
Error types
ZeroDropTimeoutError
Raised when no email arrives within the timeout.ZeroDropHeldError
Raised when ZeroDrop held the email. Without an API key, one sender can reach only 5 different inboxes a day. Past that, the email isn’t stored, and the inbox gets a notice fromnotice@zerodrop.dev instead. wait_for_latest() raises at once rather than waiting for the timeout, and the message is the server’s reason. A free key from zerodrop.dev/keys lifts the limit for inboxes under your key’s prefix.
ZeroDropHeldError is new in zerodrop 0.3.0. Older versions treat the notice as an email: without a filter, wait_for_latest returns it (its otp is None), and a filter such as ZeroDropFilter(has_otp=True) skips it, so the wait ends in ZeroDropTimeoutError.
ZeroDropNetworkError
Raised when the API is unreachable. Includes a link to the status page.ZeroDropAuthError
Raised on a 401: the inbox belongs to an account’s prefix and the request had no key or the wrong one. The message carries the server’s reason.pytest example
Parallel test runs
generate_inbox() runs locally — no network request, no throttling. Without an API key, though, one sender can reach only 5 different inboxes a day; with a free key, inboxes under your prefix aren’t counted:
Workspace domain
A Workspace receives mail on a domain of its own, such asyourcompany-qa.com, so sign-up forms that block disposable domains accept it, and every inbox on it can be read only with your key. Set the domain as ZERODROP_DOMAIN, or pass it as domain= (zerodrop 0.4.0 or later), next to your key:
mail.wait_for_latest("qa@yourcompany-qa.com") reads the inbox k7x2-qa, where ZeroDrop files that mail. mail.domain holds the domain in use. Use the domain as your API keys page shows it. See Workspaces for how mail on it is filed.
Free vs Workspace
Get a Workspace at zerodrop.dev/pricing
Zero telemetry
The SDK does not send analytics, usage metrics, or environment data to any server. The only network requests made are explicit inbox polls tozerodrop.dev/api/inbox/{name}.
Your CI pipeline is your business.