Skip to main content

Official Python SDK for the Verifly email-verification API (verifly.email)

Project description

verifly-email (Python)

Official Python SDK for the Verifly email-verification API.

Package naming. Install verifly-email and import verifly_email. The plain name verifly on PyPI belongs to an unrelated 2FA company — it is not this project. Always use verifly-email.

  • Zero dependencies (pure Python standard library).
  • Fully typed, with docstrings on every method.
  • Built-in retry with backoff on 429 / 5xx (honors Retry-After).
  • Automatic Idempotency-Key for buy_credits and submit_bulk.
  • Typed VeriflyError(code, message, request_id) on API error envelopes.

Install

pip install verifly-email          # once published
# or, from this repo:
pip install /path/to/sdks/python

Quick start

from verifly_email import VeriflyClient, VeriflyError

client = VeriflyClient("vf_your_api_key")   # base_url defaults to https://verifly.email

try:
    r = client.verify("bill.gates@microsoft.com")
    print(r["result"])           # deliverable | undeliverable | risky | unknown
    print(r["recommendation"])   # safe_to_send | risky | do_not_send
    print(r["credits"])          # {"used": 1, "remaining": 99}
except VeriflyError as e:
    print(e.code, e.message, e.request_id)

Authentication

Every call (except register) authenticates with your vf_ key, sent as Authorization: Bearer <api_key>.

client = VeriflyClient(api_key="vf_...", base_url="https://verifly.email")

Create an account programmatically

res = VeriflyClient.register("you@example.com", "a-strong-password")
api_key = res["api_key"]["key"]   # shown ONCE — store it now
client = VeriflyClient(api_key)

Methods

Method Description
verify(email) Verify a single address.
verify_batch(emails, deduplicate=True, ...) Verify up to 100 addresses synchronously.
clean(emails, options=None) Clean/filter a list (no verification, no credits).
extract(text, deduplicate=True, lowercase=True) Pull email addresses out of text/CSV.
submit_bulk(emails=None, text=None, webhook_url=None, ...) Create an async bulk job (up to 1M).
jobs(status=None, limit=None, offset=None) List bulk jobs.
job(job_id) Get a bulk job's status.
job_results(job_id) Get a completed job's per-email results.
account() Account profile + credit summary.
credits() Current credit balance.
usage(period=None, limit=None) API usage summary (day/week/month).
packages() List credit packages and prices.
payment_history() List payment history.
buy_credits(package_id, method="stripe", currency=None) Create a Stripe/crypto checkout.
VeriflyClient.register(email, password) (classmethod) Self-register, returns account + API key.

Examples

# Batch (<=100), synchronous
batch = client.verify_batch(
    ["a@example.com", "b@example.com"],
    exclude_role_accounts=True,
)
for item in batch["results"]:
    print(item["email"], item["result"])

# List hygiene without spending credits
print(client.clean(["A@Example.com ", "a@example.com", "bad"])["..."])
print(client.extract("contact us at sales@acme.io or ceo@acme.io"))

# Async bulk + polling
job = client.submit_bulk(emails=[...], webhook_url="https://you/webhook")
status = client.job(job["job_id"] if "job_id" in job else job["job"]["id"])
results = client.job_results(job_id)

# Account / billing
print(client.credits())
print(client.packages())
checkout = client.buy_credits("pro", method="stripe")
checkout = client.buy_credits("pro", method="crypto", currency="USDT")

Errors

API error envelopes ({"success": false, "error": {...}}) and non-2xx responses raise VeriflyError:

try:
    client.verify("nope")
except VeriflyError as e:
    e.code         # e.g. "invalid_email", "insufficient_credits", "rate_limit_exceeded"
    e.message
    e.request_id   # from the x-request-id response header
    e.status       # HTTP status
    e.suggestion   # optional remediation hint

Retries & idempotency

  • 429 and 5xx responses are retried (default 3 times) with exponential backoff, honoring the Retry-After header. Configure via VeriflyClient(..., max_retries=N, timeout=seconds).
  • buy_credits and submit_bulk send an Idempotency-Key header. One is auto-generated per call; pass your own with idempotency_key=... to make a specific retry safe end-to-end.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verifly_email-1.0.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verifly_email-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file verifly_email-1.0.0.tar.gz.

File metadata

  • Download URL: verifly_email-1.0.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for verifly_email-1.0.0.tar.gz
Algorithm Hash digest
SHA256 21e4afc3ceedd58bca5075700d5937771987a154a680b2d601d5e179fbde9074
MD5 73014bd992881cd0b96b1338b9fe946e
BLAKE2b-256 1a41f4e5fe494d0bab0582a6ddd08068a2f39d205cb855d9c66c3456cf8100f9

See more details on using hashes here.

File details

Details for the file verifly_email-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: verifly_email-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for verifly_email-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecf522ad8725c34752336e7a563f19d43c97a349b2bfba0d1694ccb2fd2f12bd
MD5 531c57d56f6424430f5a464e5dc54ce6
BLAKE2b-256 238cb847c6be0958d790dc5f0e5d42d0503e23f462ff042c778feeeaa6a52106

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page