Overview
The Temp Mail Detector API allows website owners to check if an email provided is a temporary or disposable email provider.
Important: When implementing this API, you should never send us your customers’ full email. We only validate the domain, and where a full email is provided, we strip away the user part before processing the request.
Important: Due to sub-domains (sub.test.com) and multi-level country codes (sub.test.co.uk), you should split your email string using @
and send the full domain in your request.
Endpoint /check
Checks if an email address is a temporary or disposable email address.
URL
POST https://api.tempmaildetector.com/check
Headers
Content-Type: application/json
Authorization: {YOUR_API_KEY}
Request Body
The request body should be in JSON format and contain the following parameter:
domain
(string, required): The domain (also known as the host) of the email address to be checked.
{
"domain": "host.com"
}
cURL Example Request
curl --request POST \
--url https://api.tempmaildetector.com/check \
--header 'Content-Type: application/json' \
--header 'Authorization: {YOUR_API_KEY}' \
--data '{"domain":"host.com"}'
Example Response
{
"domain": "host.com",
"score": 90,
"meta": {
"block_list": false,
"domain_age": 0,
"website_resolves": false,
"accepts_all_addresses": false,
"valid_email_security": false
}
}
Field Descriptions
Key | Type | Description |
---|---|---|
domain | string | The domain provided. |
score | int | A risk score from 0 - 100. |
meta | object | Meta object containing additional information about the domain provided. |
meta.block_list | bool | Indicates if the domain is already in the block list. |
meta.domain_age | int | Domain age in years. -1 indicates that a WHOIS did not provide a creation date. |
meta.website_resolves | bool | Indicates if the email domain has a resolvable website. |
meta.accepts_all_addresses | bool | Indicates if the email domain accepts any email address. |
meta.valid_email_security | bool | Indicates if the email domain has valid email security measures in place. |
Error Handling
The API will return appropriate HTTP status codes to indicate success or failure of the request. Common status codes include:
200 OK
: The request was successful.400 Bad Request
: The request was malformed or missing required parameters.401 Unauthorized
: The API key provided is invalid or missing.402 Payment Required
: Your account has run out of lookups.500 Internal Server Error
: An error occurred on the server.
Good to know:
invalid_domain_or_mx
is returned when an invalid domain such asgmail.cim
is provided or a mail server could not be found.error_processing_domain
is returned when a domain could not be processed, or a malformed domain is provided.no_lookups_remaining
is returned when your key has run out of lookups.
Ensure to handle these responses appropriately in your application.
Terms of Service and GDPR disclaimer
You may wish to update your Terms of Service and GDPR statements outlining that you make use of a 3rd party to manage email reputation:
Our website uses TempMailDetector.com as a Data Processor to identify and block temporary or disposable email addresses during sign-up. This helps prevent abuse and is processed under our legitimate interest in maintaining service integrity (GDPR Art. 6(1)(f)).
Need help?
Just drop us an email: [email protected]