Validate Email API
The Validate Email API allows you to check whether a given email address is valid and return its metadata.
From 8,862 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 355ms | 399ms | 419ms | 700ms | 1089ms |
Similar APIs
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
emailrequiredEmail address to validate.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
is_validbooleanWhether the email address is valid.
domainstringDomain of the email address.
emailstringEmail address.
mx_recordsbooleanWhether the domain has MX records.
is_disposablebooleanWhether 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_publicbooleanWhether 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_categorystringThe main category (L1) of the email role based on its local part (prefix). See the Category Mappings table below for all possible values.
sub_categorystringThe 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 Category | Sub-Category |
|---|---|
| technical_operations | smtp_mail_administration |
| dns_domain_administration | |
| web_server_administration | |
| network_operations | |
| customer_engagement | general_inquiries |
| sales_business_development | |
| customer_support | |
| billing_orders | |
| automated_transactional | noreply_unmonitored |
| notifications_alerts | |
| transactional_processing | |
| corporate_functions | human_resources |
| finance_accounting | |
| legal_contracts | |
| operations_facilities | |
| research_development | |
| security_compliance | abuse_incident_response |
| security_operations | |
| privacy_regulatory_compliance | |
| executive_leadership | csuite_executives |
| management_boards | |
| industry_specific | hospitality_travel |
| ecommerce_retail | |
| education | |
| healthcare_medical | |
| real_estate_property | |
| financial_services_banking | |
| media_publishing | |
| nonprofit_government | nonprofit_government |
| marketing_communications | press_media_relations |
| marketing_operations | |
| newsletter_content |
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/validateemail?email=info@api-ninjas.comHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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
Can I use the Validate Email API for commercial purposes?
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.How do I get an API key and start using the Validate Email API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Validate Email API fails?
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.How does the Validate Email API determine whether an email address is valid?
The single/v1/validateemailendpoint checks the formatting of the email and verifies the existence of DNS records for the domain, returning anis_validboolean along with amx_recordsfield indicating whether the domain has MX records. To validate phone numbers as well, see the Validate Phone API.What fields does the Validate Email API response include?
For a givenemailquery parameter, the response returnsis_valid,domain,email,mx_records,is_disposable,is_public, plusmain_categoryandsub_categoryclassifying the email role from its local part; you can try it live on the API page.How does the API detect disposable and public email addresses?
Theis_disposablefield is checked against a database of hundreds of thousands of disposable domains, whileis_publicis 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.What do the main_category and sub_category fields represent?
Themain_category(L1) andsub_category(L2) classify the role of the email based on its prefix, such ascustomer_engagementwithgeneral_inquiriesortechnical_operationswithdns_domain_administration; if you only need to verify a domain's mail servers, try the MX Lookup API.