Overview
DMARC Validator queries TXT records at `_dmarc.<domain>`, after removing any scheme and leading `www.` from `domain`. The first record beginning with `v=DMARC1` (case-insensitive) becomes `dmarc_record`, and `hasDmarc` and `valid` become true. The record is split on `;` and each tag on its first `=`.
`p` is checked against `none`, `quarantine` and `reject`; any other value adds `INVALID_POLICY` to `issues`, and a missing `p` adds `MISSING_POLICY`. `pct` is returned as a number clamped to 0 to 100, and a non-numeric value is reported as 100 with an `INVALID_PCT` issue. `pct` stays null when the tag is absent, which means the default of 100. `ri` is returned as a number. `sp`, `adkim`, `aspf`, `fo` and `rf` are passed through as written and are null when absent.
`rua` and `ruf` strip `mailto:` from each comma-separated address and drop any `!size` suffix. `valid` is true only when every address is a well-formed email; `domain` is the domain of the first one.
`isEnforced` is true only when the policy is `quarantine` or `reject` and `pct` is absent or 100. `riskScore` starts from the policy: 75 for no record or no policy, 60 for `none` or an unrecognised value, 30 for `quarantine` and 5 for `reject`. It then adds 20 when an enforcing policy covers less than 100 percent of mail. `riskLevel` is high at 60 or above, medium from 25 and low below that. If DNS does not answer, the call returns a 503 instead of reporting the domain as unprotected. Results are cached for 30 minutes. On the Free plan the report addresses and their `valid` flags, `isEnforced`, `riskScore` and `riskLevel` are removed.
Live Test DMARC Validator API →
Endpoint
One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.
curl "https://api.apiverve.com/v1/dmarcvalidator?domain=paypal.com" \
-H "x-api-key: your_api_key_here"const res = await fetch('https://api.apiverve.com/v1/dmarcvalidator?domain=paypal.com', {
headers: { 'x-api-key': 'your_api_key_here' },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data } = await res.json();
console.log(data);import requests
res = requests.get(
"https://api.apiverve.com/v1/dmarcvalidator?domain=paypal.com",
headers={"x-api-key": "your_api_key_here"},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"])package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/dmarcvalidator?domain=paypal.com", nil)
req.Header.Set("x-api-key", "your_api_key_here")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.
Authentication
Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Parameters
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.
| Parameter | Type | Description |
|---|---|---|
domainRequired | string | The domain to validate the DMARC record for domain |
Response
Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.
{
"status": "ok",
"error": null,
"data": {
"host": "paypal.com",
"dmarcHost": "_dmarc.paypal.com",
"hasDmarc": true,
"dmarc_record": "v=DMARC1; p=reject; rua=mailto:d@rua.agari.com,mailto:dmarc_agg@vali.email; ruf=mailto:d@ruf.agari.com,mailto:MTc4Mzcw@ruf.vali.email",
"rua": {
"email": "d@rua.agari.com,dmarc_agg@vali.email",
"domain": "rua.agari.com",
"valid": true
},
"ruf": {
"email": "d@ruf.agari.com,MTc4Mzcw@ruf.vali.email",
"domain": "ruf.agari.com",
"valid": true
},
"v": "DMARC1",
"p": "reject",
"sp": null,
"pct": null,
"adkim": null,
"aspf": null,
"fo": null,
"rf": null,
"ri": null,
"valid": true,
"issues": [],
"isEnforced": true,
"riskScore": 5,
"riskLevel": "low"
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
host | string | "paypal.com" | The domain name that was validated |
dmarcHost | string | "_dmarc.paypal.com" | The DMARC DNS record hostname for the domain |
hasDmarc | boolean | true | Indicates whether a DMARC record exists for domain |
dmarc_record | string | "v=DMARC1; p=reject; rua=mailto:d@rua.agari.com,mailto:dmarc_agg@vali.email; ruf=mailto:d@ruf.agari.c…" | The complete DMARC record string from DNS |
rua | object | {...} | Aggregate report destination from the rua tag, with the address and whether it is valid |
emailPremium | string | "d@rua.agari.com,dmarc_agg@vali.email" | Email address for aggregate report delivery |
domain | string | "rua.agari.com" | Domain name extracted from aggregate report email |
validPremium | boolean | true | Indicates if aggregate report email is valid |
ruf | object | {...} | Forensic report destination from the ruf tag, with the address and whether it is valid |
emailPremium | string | "d@ruf.agari.com,MTc4Mzcw@ruf.vali.email" | Email address for forensic report delivery |
domain | string | "ruf.agari.com" | Domain name extracted from forensic report email |
validPremium | boolean | true | Indicates if forensic report email is valid |
v | string | "DMARC1" | DMARC protocol version from record |
p | string | "reject" | DMARC policy for domain (reject, quarantine, none) |
sp | object | null | Policy applied to subdomains from the sp tag; null when the record does not set one |
pct | object | null | Percentage of mail the policy applies to from the pct tag; null means the default of 100 |
adkim | object | null | DKIM alignment mode from the adkim tag, relaxed or strict; null means the default of relaxed |
aspf | object | null | SPF alignment mode from the aspf tag, relaxed or strict; null means the default of relaxed |
fo | object | null | Forensic reporting options from the fo tag, controlling when a report is generated |
rf | object | null | Forensic report format from the rf tag |
ri | object | null | Requested interval between aggregate reports in seconds, from the ri tag |
valid | boolean | true | Overall validation status of DMARC record |
issues | array | [] | Problems found in the record, such as a missing policy or an unreachable report address |
isEnforcedPremium | boolean | true | Whether the domain actively enforces DMARC — policy is quarantine or reject and applied to 100% of mail. False for monitoring-only (p=none), partial rollout (pct<100), or no DMARC record |
riskScorePremium | number | 5 | Composite 0-100 email-spoofing risk based on the DMARC policy and rollout percentage — higher means the domain is more easily spoofed (no DMARC or p=none scores high; enforced reject scores low) |
riskLevelPremium | string | "low" | Risk band derived from the score: low, medium or high |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted | A key restriction or IP allow-list; see key scoping. |
429 | Rate limited, or out of credits | Read error to tell them apart; see rate limits. |
Start from a template
A working app built on this API, ready to deploy with your own key. Vercel asks for the key when you deploy; the code is on GitHub to change first.
Email Security Checker
Grade any domain’s SPF and DMARC setup from A to F, with both records decoded and a checklist of what to fix.
- Next.js
- TypeScript
Also uses SPF Validator
Use cases
- Vendor Security Audits
- Audit partner domains during vendor reviews by inspecting their published DMARC policy and flagging entries set to none instead of reject.
- Outbound Campaign Verification
- Before sending mass marketing broadcasts, deliverability platforms verify sender domains to confirm that DMARC records exist and specify strict alignment modes.
- Inbound Mail Protection
- To stop spoofed sender addresses, secure email gateways evaluate incoming message domains against live DMARC policies and quarantine suspicious traffic.
- Domain Portfolio Health
- DNS administrators track customer domains across registrars to detect misconfigured report addresses, missing subdomain policies, and unaddressed syntax issues.
Other ways to use DMARC Validator
Set up DMARC Validator on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.
Related
More in Domain Data:
