Endpoint /check
Checks if an email address is a temporary or disposable email address.
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.
URL
POST https://api.tempmaildetector.com/check
Headers
Content-Type: application/jsonAuthorization: Bearer {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: Bearer {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,
"forwarding": true
}
}
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. |
| meta.forwarding | bool | Indicates if the email is using a forwarding service. |
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_mxis returned when an invalid domain such asgmail.cimis provided or a mail server could not be found.error_processing_domainis returned when a domain could not be processed, or a malformed domain is provided.no_lookups_remainingis returned when your key has run out of lookups.
Ensure to handle these responses appropriately in your application.