API Documentation

API Reference

Integrate MailAudit services into your own application. Free API access for MX record and blacklist checks.

No API key

Ready to use, no registration required

Rate limit

60 requests / minute / IP address

Base URL

https://api.mailaudit.io

Endpoints

MX record check

GET/tools/mx-check

Query a domain's MX records, as well as SPF and DMARC settings.

Parameters

domainstringrequired
The domain name to check (e.g. example.com)

Example request

bash
curl "https://api.mailaudit.io/tools/mx-check?domain=gmail.com"

Response example

json
1{
2  "domain": "gmail.com",
3  "hasMx": true,
4  "records": [
5    {
6      "exchange": "gmail-smtp-in.l.google.com",
7      "priority": 5,
8      "ip": ["142.250.150.27"]
9    },
10    {
11      "exchange": "alt1.gmail-smtp-in.l.google.com",
12      "priority": 10,
13      "ip": ["142.250.141.26"]
14    }
15  ],
16  "hasSpf": true,
17  "spfRecord": "v=spf1 redirect=_spf.google.com",
18  "hasDmarc": true,
19  "dmarcRecord": "v=DMARC1; p=none; sp=quarantine; rua=mailto:..."
20}

Blacklist check

GET/tools/blacklist-check

Check if an IP address or domain is on major spam blocklists (23+ DNSBL).

Parameters

querystringrequired
IP address (e.g. 192.168.1.1) or domain name

Example request

bash
curl "https://api.mailaudit.io/tools/blacklist-check?query=8.8.8.8"

Response example

json
1{
2  "query": "8.8.8.8",
3  "queryType": "ip",
4  "totalChecked": 23,
5  "totalListed": 0,
6  "results": [
7    {
8      "name": "Spamhaus ZEN",
9      "zone": "zen.spamhaus.org",
10      "listed": false,
11      "responseTime": 45
12    },
13    {
14      "name": "Barracuda",
15      "zone": "b.barracudacentral.org",
16      "listed": false,
17      "responseTime": 32
18    }
19    // ...
20  ]
21}

Domain reputation check

GET/tools/reputation

Comprehensive domain reputation score calculation. Checks SPF, DKIM, DMARC, MX records, blacklist status, STARTTLS support, domain age, and reverse DNS.

Parameters

domainstringrequired
The domain name to check (e.g. gmail.com)

Example request

bash
curl "https://api.mailaudit.io/tools/reputation?domain=gmail.com"
Grading Scale
90-100 = A+
80-89 = A
70-79 = B
60-69 = C
50-59 = D
0-49 = F

Response example

json
1{
2  "domain": "gmail.com",
3  "ip": "142.250.150.27",
4  "score": 100,
5  "grade": "A+",
6  "factors": [
7    { "name": "SPF", "status": "pass", "detail": "Policy: present", "impact": 15 },
8    { "name": "DKIM", "status": "warn", "detail": "Not found", "impact": 0 },
9    { "name": "DMARC", "status": "warn", "detail": "Policy: none", "impact": 5 },
10    { "name": "MX Records", "status": "pass", "detail": "5 record(s)", "impact": 10 },
11    { "name": "Blacklists", "status": "pass", "detail": "Clean (10 checked)", "impact": 20 },
12    { "name": "STARTTLS", "status": "pass", "detail": "Supported", "impact": 10 },
13    { "name": "Domain Age", "status": "pass", "detail": "30.3 years", "impact": 10 },
14    { "name": "Reverse DNS", "status": "pass", "detail": "wa-in-f27.1e100.net", "impact": 5 }
15  ],
16  "details": {
17    "mx": { "valid": true, "count": 5, "primary": "gmail-smtp-in.l.google.com" },
18    "spf": { "valid": true, "record": "v=spf1 redirect=_spf.google.com" },
19    "dkim": { "valid": false, "selectors": [] },
20    "dmarc": { "valid": true, "policy": "none", "rua": ["mailto:..."] },
21    "blacklists": { "checked": 10, "listed": 0, "clean": true },
22    "tls": { "valid": true, "starttls": true },
23    "domainAge": { "valid": true, "years": 30.3, "registrationDate": "1995-08-13" },
24    "rdns": { "valid": true, "hostname": "wa-in-f27.1e100.net" }
25  },
26  "checkedAt": "2025-12-03T07:05:46.232Z",
27  "cached": false
28}

HTTP Status Codes

CodeStatusDescription
200OKSuccessful request
400Bad RequestMissing or invalid parameter
429Too Many RequestsRate limit exceeded (60/minute)
500Internal Server ErrorServer side error

Error Responses

In case of error, the response contains an error field with the error description:

json
{
  "error": "Domain is required"
}

Code Examples

JavaScript / Node.js

javascript
1// Query MX records
2const response = await fetch(
3  'https://api.mailaudit.io/tools/mx-check?domain=example.com'
4);
5const data = await response.json();
6
7if (data.hasMx) {
8  console.log('MX records:', data.records);
9  console.log('SPF:', data.hasSpf ? data.spfRecord : 'None');
10  console.log('DMARC:', data.hasDmarc ? data.dmarcRecord : 'None');
11}

Python

python
1import requests
2
3# Blacklist check
4response = requests.get(
5    'https://api.mailaudit.io/tools/blacklist-check',
6    params={'query': '192.168.1.1'}
7)
8data = response.json()
9
10print(f"Checked: {data['totalChecked']} lists")
11print(f"Listed on: {data['totalListed']} places")
12
13for result in data['results']:
14    if result['listed']:
15        print(f"⚠️  {result['name']}: LISTED")

Python - Reputation Check

python
1import requests
2
3# Domain reputation check
4response = requests.get(
5    'https://api.mailaudit.io/tools/reputation',
6    params={'domain': 'example.com'}
7)
8data = response.json()
9
10print(f"Score: {data['score']}/100 ({data['grade']})")
11print("\nFactors:")
12for factor in data['factors']:
13    icon = "✅" if factor['status'] == 'pass' else "⚠️" if factor['status'] == 'warn' else "❌"
14    print(f"  {icon} {factor['name']}: {factor['detail']} ({factor['impact']:+d})")

PHP

php
1<?php
2// MX check
3$domain = 'example.com';
4$url = "https://api.mailaudit.io/tools/mx-check?domain=" . urlencode($domain);
5
6$response = file_get_contents($url);
7$data = json_decode($response, true);
8
9if ($data['hasMx']) {
10    foreach ($data['records'] as $mx) {
11        echo "MX: {$mx['exchange']} (priority: {$mx['priority']})\n";
12    }
13}
14?>

Want to try the API?

Try our tools on the web interface, or start developing with the API.