Python SDK for Enrichr — a micro-toll utility API warehouse. One API key. 40 endpoints. Fractions of a cent per call.
pip install enrichr-sdkRequires Python 3.10+ and httpx.
from enrichr import Enrichr
client = Enrichr("enr_your_api_key")
# Validate an email
result = client.enrich.email("user@example.com")
print(result["data"]["valid"]) # True
print(result["data"]["disposable"]) # False
print(result["cost_usd"]) # 0.0001
# Generate a slug
slug = client.generate.slug("Hello World! Café & More")
print(slug["data"]["slug"]) # hello-world-cafe-more
# Validate a credit card (Luhn + network, number never stored)
card = client.validate.credit_card("4111 1111 1111 1111")
print(card["data"]["network"]) # Visa
# Convert units
result = client.convert.units(100, "km", "mi")
print(result["data"]["result"]) # 62.137...import asyncio
from enrichr import AsyncEnrichr
async def main():
async with AsyncEnrichr("enr_your_api_key") as client:
email = await client.enrich.email("user@example.com")
slug = await client.generate.slug("Hello World")
ip = await client.enrich.ip("8.8.8.8")
print(ip["data"]["city"]) # Mountain View
asyncio.run(main())| Method | Description |
|---|---|
.email(email) |
Validate email (format, MX, disposable) |
.phone(phone, country_hint="US") |
Parse phone to E.164, detect line type |
.address(street, city, ...) |
Normalize postal address |
.ip(ip) |
Geolocate IP (country, city, ISP, timezone) |
.classify(text) |
Sentiment, toxicity, spam, language |
| Method | Description |
|---|---|
.currency(amount, from_currency, to_currency) |
ECB rates, updated daily |
.timezone(datetime, from_tz, to_tz) |
DST-aware IANA timezone conversion |
.units(value, from_unit, to_unit) |
Length, weight, temperature, area, volume |
.number(value, from_base) |
decimal ↔ binary ↔ octal ↔ hex ↔ Roman |
.case(text) |
camelCase, snake_case, PascalCase + 6 more |
.html_to_text(html) |
Strip HTML tags |
.markdown(markdown) |
Markdown → HTML |
.encoding(text, codec, operation) |
base64, hex, url, html, rot13 |
| Method | Description |
|---|---|
.vat(vat_number) |
EU VAT — format + VIES check |
.password(password) |
HIBP breach check + strength score |
.credit_card(number) |
Luhn + network (Visa, MC, Amex, …) |
.iban(iban) |
MOD-97 checksum, 77 countries |
.json(json_string) |
Validate + format + analyze JSON |
.color(color) |
hex/rgb/hsl conversion |
.domain(domain) |
Format + DNS A + MX check |
.regex(pattern, test_string) |
Test regex, return all matches |
.uuid(uuid) |
Validate + detect version (v1–v5) |
| Method | Description |
|---|---|
.qr(content) |
QR code → base64 PNG + data URI |
.uuid(version=4, count=1) |
UUID v1 or v4, up to 100 |
.hash(text, algorithm="sha256") |
MD5/SHA-1/SHA-256/SHA-512 |
.password(length=16, ...) |
Secure random password + entropy |
.slug(text) |
URL-safe slug (Unicode-aware) |
.avatar(name) |
SVG initials avatar |
.lorem(paragraphs=1) |
Lorem ipsum text |
.token(length=32, style="hex") |
hex / url_safe / alphanumeric / api_key |
| Method | Description |
|---|---|
.text(text) |
Word count, reading time, Flesch readability |
| Method | Description |
|---|---|
.profanity(text) |
Detect + censor profanity |
| Method | Description |
|---|---|
.postal(postal_code, country="US") |
City, state, coords (60+ countries) |
.country(query) |
Country by ISO code or name |
.timezone(timezone) |
IANA timezone info (offset, DST, abbr) |
.mime_type(query) |
Extension → MIME or MIME → extensions |
| Method | Description |
|---|---|
.url(url) |
Scheme, host, path, params, UTM tags |
.user_agent(user_agent) |
Browser, OS, device, bot detection |
.csv(csv_string) |
CSV string → structured rows |
.date(date_string) |
Parse any date string |
| Method | Description |
|---|---|
.signup(email) |
Create an API key |
.usage() |
Monthly call count + estimated charge |
from enrichr import Enrichr, EnrichrError
client = Enrichr("enr_your_key")
try:
result = client.enrich.email("bad@example.com")
except EnrichrError as e:
print(e.status_code, str(e))First 1,000 calls/month are free. After that:
- Most utility endpoints: $0.00001/call (one-hundredth of a cent)
- Enrichment endpoints: $0.0001/call
- VAT, address: $0.0005/call
Full pricing at enrichrapi.dev.
MIT