MX Lookup API
The MX Lookup API retrieves mail exchange (MX) records for any given domain.
From 5,110 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 328ms | 377ms | 375ms | 726ms | 1006ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/mxlookup GET
https://api.api-ninjas.com/v1/mxlookup
Returns a list of MX records associated with a particular domain. Free users receive only data from the first MX record, while premium users get access to all MX records.
Parameters
domainrequiredValid domain to check (e.g.
x.com). All top-level domains are supported.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
priorityPriority value of the MX record (lower numbers indicate higher priority).
valueThe mail server hostname.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/mxlookup?domain=x.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/mxlookup?domain=example.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 MX Lookup API for commercial purposes?
How do I get an API key and start using the MX Lookup API?
What happens if I exceed my quota for the month?
What happens if a request to the MX Lookup API fails?
What are some use cases for the MX Lookup API?
How do I look up the MX records for a specific domain?
What fields are included in the MX Lookup API response?
Does the MX Lookup API return all MX records for a domain?