NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Validate Email API

The Validate Email API allows you to check whether a given email address is valid and return its metadata.

(4.3)

From 8,862 users

3,200+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
355ms399ms419ms700ms1089ms

Didn't find what you were looking for? Suggest an improvement


/v1/validateemail GET

https://api.api-ninjas.com/v1/validateemail

Returns metadata (including whether it is valid) for a given email address. This API will check the formatting of the email and the existence of DNS records for the domain to make sure it is a valid email address.

Parameters

  • email  required

    Email address to validate.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • is_valid  boolean

    Whether the email address is valid.

  • domain  string

    Domain of the email address.

  • email  string

    Email address.

  • mx_records  boolean

    Whether the domain has MX records.

  • is_disposable  boolean

    Whether the email address is disposable. We maintain a large database of hundreds of thousands of disposable domains and check against it for every email address.

  • is_public  boolean

    Whether the email address comes from a public email domain like Gmail or Yahoo Mail. We match the email domain against our constantly-updated database of millions of known public email providers.

  • main_category  string

    The main category (L1) of the email role based on its local part (prefix). See the Category Mappings table below for all possible values.

  • sub_category  string

    The sub-category (L2) of the email role based on its local part (prefix). See the Category Mappings table below for all possible values.

Email Role Category Mappings

The following table shows all possible email role categories and sub-categories based on the email prefix (local part).

 Click to expand/collapse category mappings table
Main CategorySub-Category
technical_operationssmtp_mail_administration
dns_domain_administration
web_server_administration
network_operations
customer_engagementgeneral_inquiries
sales_business_development
customer_support
billing_orders
automated_transactionalnoreply_unmonitored
notifications_alerts
transactional_processing
corporate_functionshuman_resources
finance_accounting
legal_contracts
operations_facilities
research_development
security_complianceabuse_incident_response
security_operations
privacy_regulatory_compliance
executive_leadershipcsuite_executives
management_boards
industry_specifichospitality_travel
ecommerce_retail
education
healthcare_medical
real_estate_property
financial_services_banking
media_publishing
nonprofit_governmentnonprofit_government
marketing_communicationspress_media_relations
marketing_operations
newsletter_content

Sample Request Live Demo!

email

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/validateemail?email=info@api-ninjas.com

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    is_valid:true,
    domain:"api-ninjas.com",
    email:"info@api-ninjas.com",
    mx_records:true,
    main_category:"customer_engagement",
    sub_category:"general_inquiries",
    is_disposable:false,
    is_public:false
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/validateemail?email=info@api-ninjas.com" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Validate Email API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The single /v1/validateemail endpoint checks the formatting of the email and verifies the existence of DNS records for the domain, returning an is_valid boolean along with a mx_records field indicating whether the domain has MX records. To validate phone numbers as well, see the Validate Phone API.
  • For a given email query parameter, the response returns is_valid, domain, email, mx_records, is_disposable, is_public, plus main_category and sub_category classifying the email role from its local part; you can try it live on the API page.
  • The is_disposable field is checked against a database of hundreds of thousands of disposable domains, while is_public is matched against a constantly-updated database of millions of known public email providers like Gmail and Yahoo Mail; for dedicated disposable detection see the Disposable Email Checker API.
  • The main_category (L1) and sub_category (L2) classify the role of the email based on its prefix, such as customer_engagement with general_inquiries or technical_operations with dns_domain_administration; if you only need to verify a domain's mail servers, try the MX Lookup API.