Skip to main content

Official Python SDK for the APIddress email validation API

Project description

apiddress

Official Python SDK for the APIddress email validation API.

  • Zero runtime dependencies (stdlib urllib only)
  • Python 3.9+, fully type-hinted, frozen dataclass responses
  • Automatic retry with backoff on 429 and 5xx (batch creation is never retried)

Install

pip install apiddress

Quickstart

from apiddress import Client

client = Client("YOUR_API_KEY")

result = client.validate_email("ada@stripe.com")
print(result.status)  # "valid"
print(result.score)   # 0.98

Configuration

client = Client(
    "YOUR_API_KEY",
    base_url="https://api.apiddress.com",  # default
    timeout=10.0,                          # per-request timeout (seconds), default 10
    max_retries=2,                         # retries on 429/5xx, default 2
)

Usage

Validate one email

result = client.validate_email(
    "john@company.com",
    check_smtp=False,        # default
    allow_role_based=True,   # server default
)
# result.status: "valid" | "invalid" | "risky" | "disposable" | "unknown"
# result.suggestion: "john@gmail.com" for typo-like addresses, else None
# result.checks: ValidationChecks(syntax, domain_exists, mx, smtp, disposable, ...)

A malformed value (e.g. "not-an-email") is a verdict, not an error: you get status == "invalid" with reason == "invalid_syntax".

Validate up to 100 emails synchronously

response = client.validate_emails(["a@example.com", "b@example.com"])
print(response.count, [r.status for r in response.results])

Batch jobs (up to 5000 emails)

batch = client.create_batch(
    emails,
    callback_url="https://yourapp.com/webhooks/apiddress",  # optional
)

done = client.wait_for_batch(
    batch.batch_id,
    poll_interval=1.0,  # default
    timeout=60.0,       # default
)
print(done.status, len(done.results))

# Or poll yourself:
status = client.get_batch(batch.batch_id)

wait_for_batch returns the terminal state ("completed" or "failed") — check status before using results.

Account

profile = client.me()         # plan, limits, usage
usage = client.usage()        # current month
may = client.usage("2026-05") # specific month
health = client.health()      # no auth required

Error handling

Every failed request raises an APIddressError:

from apiddress import APIddressError, Client

try:
    client.validate_email("john@company.com")
except APIddressError as err:
    print(err.status, err.code, err.message, err.details)
    # 429 quota_exceeded "Monthly request limit exceeded." {"requests_used": ..., "requests_limit": ...}
status code
400 invalid_request
401 unauthorized
404 not_found
429 quota_exceeded
500 internal_error
0 timeout (request or wait_for_batch timeout)

Development

python3 -m venv .venv
.venv/bin/pip install -e . pytest

# Integration tests need a live backend:
APIDDRESS_BASE_URL=http://localhost:3000 APIDDRESS_API_KEY=test_key_local_dev \
  .venv/bin/pytest

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

apiddress-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

apiddress-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file apiddress-0.1.0.tar.gz.

File metadata

  • Download URL: apiddress-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for apiddress-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ffb3aa79753283bd45de494d634f9c4e591ae8d94eef0e7eea712e5adcd8b6f
MD5 2539e76334be8221392b302da878e1b6
BLAKE2b-256 158dfed480a0148883524e97da7c28d77d5aad25dbe2bd770fc31e1f9c710fac

See more details on using hashes here.

File details

Details for the file apiddress-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: apiddress-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for apiddress-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff7c7b2af6b9312b91841bd9fdba3e28a27182b6c8ae54f4149c3ab14625443
MD5 fbd75741408e796f45d6163e2bb7520e
BLAKE2b-256 eafad4af46d2bdae2c1d629cb3245a61a7be592e8cf0bd9aa3c7d8cc6fdde394

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