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

from identify_fake_email.client import EmailValidator

client = EmailValidator("YOUR_RAPIDAPI_KEY")

result = client.validate("user@example.com")
print(f"Valid: {result.valid_email}")
print(f"Name risk: {result.name_risk}")

if result.name_risk > 0.7 or not result.valid_email:
    print("Suspicious - review")
else:
    print("Safe to accept")

Bulk Validation

Validate up to 30 emails per request.

results = client.validate_bulk(["user1@example.com", "user2@example.com"])

for result in results:
    print(f"{result.email}: name_risk={result.name_risk}")

Low-Level Usage

If you need direct access to the underlying SDK:

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

RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
RAPIDAPI_HOST = "email-validator-syntax-mx-disposable-risk-detection.p.rapidapi.com"

config = Configuration()
config.host = f"https://{RAPIDAPI_HOST}"

client = DefaultApi(identify_fake_email.ApiClient(config))

result = client.validate_email_validate_get(
    "user@example.com",
    _headers={
        "x-rapidapi-key": RAPIDAPI_KEY,
        "x-rapidapi-host": RAPIDAPI_HOST
    }
)

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.5.tar.gz (27.6 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.5-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: identify_fake_email-1.0.5.tar.gz
  • Upload date:
  • Size: 27.6 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.5.tar.gz
Algorithm Hash digest
SHA256 87964de01f92342642a70fa62fbcc6106426c46cae82abed6387c48e29f90136
MD5 c5d2bf98ca973cf3460a37ef3647df6d
BLAKE2b-256 8599925d3378147c0cfbd597a406ca07857673065a84fbaf83a93ddd050a10ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for identify_fake_email-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 661209d44ed69d93996fbb0327d2f8379fe8889ff27cd9755325a995cb51e0ff
MD5 7b3ec00e2bfb3701c63a9462ffeba493
BLAKE2b-256 f04082d716a3d4eea4a0d79f86f8ee30f911e6169971a8036f20be1167abceea

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