Dokumentazzjoni tal-API

Referenza tal-API

Integraw is-servizzi ta’ MailAudit fl-applikazzjoni tiegħek. Aċċess API b’xejn għal verifiki tar-rekords MX u blacklist.

Ebda ċavetta API

Lesta għall-użu, l-ebda reġistrazzjoni meħtieġa

Rate limit

60 talba / minuta / indirizz IP

Base URL

https://api.mailaudit.io

Endpoints

Verifika tar-rekord MX

GET/tools/mx-check

Fittex ir-rekords MX tad-dominju, kif ukoll is-settings SPF u DMARC.

Parametri

domainstringmeħtieġ
Id-dominju li trid tivverifika (eż. example.com)

Talba ta’ eżempju

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

Eżempju ta’ risposta

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}

Verifika blacklist

GET/tools/blacklist-check

Iċċekkja jekk indirizz IP jew dominju jinsabx fuq blocklists ewlenin tal-ispam (23+ DNSBL).

Parametri

querystringmeħtieġ
Indirizz IP (eż. 192.168.1.1) jew isem dominju

Talba ta’ eżempju

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

Eżempju ta’ risposta

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}

Verifika tar-reputazzjoni tad-dominju

GET/tools/reputation

Kalkolu komprensiv tal-punteġġ tar-reputazzjoni tad-dominju. Iċċekkja SPF, DKIM, DMARC, rekords MX, status tal-blacklist, appoġġ STARTTLS, età tad-dominju u reverse DNS.

Parametri

domainstringmeħtieġ
Id-dominju li trid tivverifika (eż. gmail.com)

Talba ta’ eżempju

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

Eżempju ta’ risposta

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}

Kodiċijiet tal-Istatus HTTP

KodiċiStatusDeskrizzjoni
200OKTalba rnexxiet
400Bad RequestParametru nieqes jew invalidu
429Too Many RequestsRate limit esaġerat (60/minuta)
500Internal Server ErrorŻball min-naħa tas-server

Risposti ta’ Żball

F’każ ta’ żball, ir-risposta tinkludi qasam error b’deskrizzjoni tal-problema:

json
{
  "error": "Domain hu meħtieġ"
}

Eżempji ta’ Kodiċi

JavaScript / Node.js

javascript
1// Query tar-rekords 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('Rekords MX:', data.records);
9  console.log('SPF:', data.hasSpf ? data.spfRecord : 'Xejn');
10  console.log('DMARC:', data.hasDmarc ? data.dmarcRecord : 'Xejn');
11}

Python

python
1import requests
2
3# Verifika 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"Iċċekkjati: {data['totalChecked']} listi")
11print(f"Elenkat fuq: {data['totalListed']} postijiet")
12
13for result in data['results']:
14    if result['listed']:
15        print(f"⚠️  {result['name']}: ELENKAT")

Python - Reputation Check

python
1import requests
2
3# Verifika tar-reputazzjoni tad-dominju
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("\nFatturi:")
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// Verifika 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']} (prijorità: {$mx['priority']})\n";
12    }
13}
14?>

Tixtieq tipprova l-API?

Ipprova l-għodod tagħna mill-interface tal-web, jew ibda tiżviluppa bl-API.