Documentation API
Référence API
Intégrez les services MailAudit dans votre propre application. Accès API gratuit pour les vérifications MX et blacklist.
Pas de clé API
Prête à l’emploi, sans inscription
Limite de requêtes
60 requêtes / minute / adresse IP
URL de base
https://api.mailaudit.io
Endpoints
Vérification d’enregistrements MX
GET
/tools/mx-checkInterroger les enregistrements MX d’un domaine ainsi que les réglages SPF et DMARC.
Paramètres
domainstringobligatoireExemple de requête
bash
curl "https://api.mailaudit.io/tools/mx-check?domain=gmail.com"Exemple de réponse
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}Vérification de blacklist
GET
/tools/blacklist-checkContrôler si une adresse IP ou un domaine figure sur les principales blocklists de spam (23+ DNSBL).
Paramètres
querystringobligatoireExemple de requête
bash
curl "https://api.mailaudit.io/tools/blacklist-check?query=8.8.8.8"Exemple de réponse
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}Contrôle de réputation de domaine
GET
/tools/reputationCalcul complet du score de réputation d’un domaine. Vérifie SPF, DKIM, DMARC, enregistrements MX, statut blacklist, support STARTTLS, ancienneté du domaine et reverse DNS.
Paramètres
domainstringobligatoireExemple de requête
bash
curl "https://api.mailaudit.io/tools/reputation?domain=gmail.com"Échelle de notation
90-100 = A+
80-89 = A
70-79 = B
60-69 = C
50-59 = D
0-49 = F
Exemple de réponse
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}Codes de statut HTTP
| Code | Statut | Description |
|---|---|---|
| 200 | OK | Requête réussie |
| 400 | Bad Request | Paramètre manquant ou invalide |
| 429 | Too Many Requests | Limite de requêtes dépassée (60/minute) |
| 500 | Internal Server Error | Erreur côté serveur |
Réponses d’erreur
En cas d’erreur, la réponse contient un champ error avec la description :
json
{
"error": "Domain is required"
}Exemples de code
JavaScript / Node.js
javascript
1// Interroger les enregistrements MX
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('Enregistrements MX :', data.records);
9 console.log('SPF:', data.hasSpf ? data.spfRecord : 'Aucun');
10 console.log('DMARC:', data.hasDmarc ? data.dmarcRecord : 'Aucun');
11}Python
python
1import requests
2
3# Vérification de blacklist
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"Vérifiées : {data['totalChecked']} listes")
11print(f"Listé sur : {data['totalListed']} entrées")
12
13for result in data['results']:
14 if result['listed']:
15 print(f"⚠️ {result['name']}: LISTÉ")Python - Reputation Check
python
1import requests
2
3# Contrôle de réputation de domaine
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("\nFacteurs :")
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// Vérification MX
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']} (priorité: {$mx['priority']})\n";
12 }
13}
14?>Envie de tester l’API ?
Essayez nos outils dans l’interface web, ou commencez directement à développer avec l’API.