Skip to main content

FastAPI

Project description

identify-fake-email

A Python SDK for the Email Validator API — ML-powered email validation that goes beyond blacklists.

Most validators rely on MX records, SMTP checks, or static blacklists. This API combines traditional checks with an XGBoost model that scores the risk of accepting an email based on patterns in the username and domain — catching auto-generated disposable emails that traditional methods miss.

Installation

pip install identify-fake-email

Requirements

  • Python 3.7+
  • A RapidAPI key (free tier available — 100 requests/month)

Quick Start

import identify_fake_email
from identify_fake_email.api.default_api import DefaultApi
from identify_fake_email.configuration import Configuration

config = Configuration()
config.api_key["x-rapidapi-key"] = "YOUR_RAPIDAPI_KEY"

client = DefaultApi(identify_fake_email.ApiClient(config))

result = client.validate_email_validate_get("user@example.com")

print(f"Valid: {result.valid_email}")
print(f"Name risk: {result.name_risk}")

if result.valid_email and result.name_risk < 0.7:
    print("Safe to accept")
else:
    print("Suspicious - review")

Bulk Validation

Validate up to 30 emails per request.

from identify_fake_email.models.bulk_emails import BulkEmails

bulk = BulkEmails(emails=["user1@example.com", "user2@example.com"])
results = client.validate_bulk_validate_bulk_post(bulk)

for result in results:
    print(f"{result.email}: name_risk={result.name_risk}")
    if result.valid_email and result.name_risk < 0.7:
        print("Safe to accept")
    else:
        print("Suspicious - review")

Response Fields

Field Type Description
email string The email address validated
valid_email_structure bool Whether the email has valid syntax
is_role bool Whether it's a role address (e.g. admin@, support@)
mx_records bool Whether the domain has valid MX records
not_disposable bool Whether the domain is on the disposable blacklist
new_domain bool Whether the domain was recently created
name_risk float (0–1) ML risk score for the username — higher means riskier
domain_risk float (0–1) ML risk score for the domain — higher means riskier
valid_email bool Overall validity based on traditional checks

Risk Scores

name_risk and domain_risk are ML-generated scores between 0 and 1. The higher the score, the more likely the email is fake or disposable.

name_risk is the more reliable of the two — auto-generated usernames follow distinct patterns (random characters, high digit count, unusual consonant/vowel ratios) that the model picks up on. domain_risk is less reliable as auto-generated domains can look similar to legitimate ones.

We recommend using name_risk as your primary signal and combining it with other fields for the most accurate result. The threshold is up to you — 0.7 is a reasonable starting point but you can adjust it for your use case.

Notes

  • SMTP validation is intentionally excluded — disposable emails have real mailboxes so SMTP returns valid, adding latency with no benefit
  • Bulk validation supports up to 30 emails per request
  • The SDK is auto-generated from the OpenAPI spec

Links

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

identify_fake_email-1.0.3.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

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

identify_fake_email-1.0.3-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file identify_fake_email-1.0.3.tar.gz.

File metadata

  • Download URL: identify_fake_email-1.0.3.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for identify_fake_email-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d314b56700ba7528964296576ee4dcc21a2960f2d0fc2b904bd640721ff5a690
MD5 5bfa1868f3f7e17d42dd67ab2a356a4b
BLAKE2b-256 11858bd1939c782952b55d8995178cd7447ee6b17eafee54e1a36363fb3d8efd

See more details on using hashes here.

File details

Details for the file identify_fake_email-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for identify_fake_email-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33ae060560e1618852777f114601cb26f19d2cce72b49f2ed05fd48d0d1ad6d6
MD5 8f7bd4b1ecb8bb4c13b1d325b2de8ff2
BLAKE2b-256 926b644cb2b009dbbededc5aa2c7a1cb360213257bf8b02b74a7e394da809124

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