A DMARC check API takes a domain name, looks up its DMARC, SPF and DKIM records in DNS, and tells you whether they're set up correctly. Fare's version is one GET request, https://api.fare.dev/v1/email-grade?domain=example.com, which returns an A–F grade, a 0–100 score and the fixes to make, in priority order.
Below: what each record does, how to check them yourself with dig, and how the hosted APIs compare.
What does a DMARC check actually look at?
Three DNS records, plus whether the domain can receive mail at all.
SPF lists the hosts allowed to send mail for a domain. RFC 7208 describes it as a way for domains to "explicitly authorize the hosts that are allowed to use their domain names," which a receiving server can then check. It lives in a TXT record on the domain itself, and evaluation must stop after 10 DNS-querying terms.
DKIM signs each message with a key the domain publishes. Per RFC 6376, the receiver checks the signature by "querying the Signer's domain directly." The public key sits at selector._domainkey.example.com, so you need to know the selector to find it.
DMARC tells receivers what to do when a message fails SPF and DKIM, and where to send reports. RFC 7489 puts it in a TXT record at _dmarc.example.com, with three policies: none (no specific action), quarantine (treat failures as suspicious) and reject.
Why does this matter more since 2024?
Gmail and Yahoo started enforcing sender rules in February 2024.
Google requires every sender to Gmail to set up SPF or DKIM. Anyone sending more than 5,000 messages a day needs SPF, DKIM and DMARC, and the From: domain must align with the SPF or DKIM domain. A DMARC policy of none is allowed.
Yahoo asks bulk senders to "Implement both SPF & DKIM" and to "Publish a valid DMARC policy with at least p=none." Relaxed alignment is fine.
So a missing or broken record now costs you inbox placement, not just a security score.
How do I check DMARC with dig?
You don't need an API to look at one domain. These are standard dig queries:
# DMARC policy
dig +short TXT _dmarc.example.com
# SPF (a TXT record on the domain that starts with v=spf1)
dig +short TXT example.com | grep 'v=spf1'
# DKIM public key: you have to know the selector
dig +short TXT selector1._domainkey.example.com
# Mail servers
dig +short MX example.com
That gets you the raw records. It doesn't tell you whether they're right. You still have to count SPF lookups, read the DMARC tags, and guess DKIM selectors. That's the part an API does for you, and it's the part worth paying for when you check many domains, or check them from code or an agent.
How do the DMARC check APIs compare?
These all have a public API you can call. Each answers a slightly different question.
| Tool | What it checks | Output | Pricing (from the vendor's page) |
|---|---|---|---|
| Fare | SPF, DMARC, DKIM (probes common selectors), MX | A–F grade, 0–100 score, ordered fixes | Per successful call; failed calls not billed |
| MxToolbox | DMARC, SPF, DKIM lookups (DKIM as domain:selector), plus many other DNS lookups | Per-lookup results | Free accounts get a small daily DNS quota; paid plans raise it |
| APIVoid DMARC Validator | DMARC record, policy, subdomain policy, reporting addresses and their MX | Parsed record, issues, valid verdict | 5 credits per call; Basic plan is $24/month for 50,000 credits |
| EasyDMARC Public API | DMARC, SPF, DKIM, BIMI and other DNS lookups, single and batch; aggregate and failure reports | JSON | Enterprise and MSP accounts; no price on the API page |
| checkdmarc | SPF, DMARC, MX/STARTTLS, DNSSEC, MTA-STS, BIMI | JSON or CSV from a CLI, or a Python module | Open source (Apache-2.0); you run it |
| Cloudflare email_auth | SPF inspection tree, SPF/DKIM/DMARC/BIMI records, DMARC reports | JSON | Endpoints are scoped to a Cloudflare zone_id |
When is another tool the better fit?
You need DMARC reports. A grade tells you whether the records are right today. It doesn't tell you who is sending as your domain. That comes from aggregate (RUA) reports, which receivers send to the address in your DMARC record. EasyDMARC's API returns aggregate reports as JSON and failure reports with attachments. Cloudflare offers DMARC reports for its own zones. If you're moving from p=none to reject, you want reports, not a one-off check.
You want to run it yourself. checkdmarc is a Python module and CLI that validates SPF and DMARC and counts SPF lookups. It's a good choice inside your own pipeline. It doesn't list DKIM among its checks.
You already use MxToolbox. Its REST API does DMARC, SPF and DKIM lookups under the same key as the rest of its DNS tools.
You only care about the DMARC record. APIVoid's validator goes deep on one record, including whether your report addresses can actually receive mail.
What does Fare's email grade return?
One call covers all three records and the MX check, and gives you a single grade.
curl "https://api.fare.dev/v1/email-grade?domain=example.com" \
-H "X-API-Key: $FARE_KEY"
The response, per the OpenAPI spec:
grade: A, B, C, D or F.score: 0–100. DMARC is worth 50 points, SPF 30, DKIM 20.spf,dmarc,dkim: each has astatus(pass,warn,failorunknown), the points it earned, the record found, and notes.mxandaccepts_mail: the domain's mail servers, and whether it takes mail.fixes: what to change, most important first.
DKIM is the awkward one, because you need a selector to find the key. Pass selector= if you know it. If you don't, Fare probes common selectors.
Can an AI agent check DMARC?
Yes. Fare runs a remote MCP server at https://api.fare.dev/mcp with one tool for this, grade_email_security. It takes a domain and an optional selector, and it's billed the same as the API.
An agent auditing a list of client domains can call it, read fixes, and write up what to change, without parsing raw TXT records.
How is it priced?
Fare is priced per call. Each Fare API has its own price, and one key and one bill cover all of them. Failed calls (4xx and 5xx) are never billed. A dns_failed error or a bad domain costs nothing, so retrying is safe.
FAQ
What is a DMARC check API?
It's an HTTP endpoint that takes a domain, reads its _dmarc TXT record (and usually SPF and DKIM), and returns whether the setup is valid. You use it to check domains from code instead of by hand.
Can I check a DMARC record without an API?
Yes. Run dig +short TXT _dmarc.example.com. An API is worth it when you need the record checked, not just fetched, or when you check many domains.
Why does DKIM need a selector?
DKIM keys are published at selector._domainkey.domain, and the selector isn't stored anywhere you can look up from the domain alone. Fare probes common selectors when you don't pass one.
Is p=none enough for Gmail and Yahoo?
For their 2024 bulk-sender rules, yes. Google and Yahoo both accept p=none, as long as DMARC passes and the From: domain aligns. It won't stop spoofing, though. quarantine or reject does.
Does a DMARC check API replace DMARC reporting?
No. A check grades the records you've published. Reporting tells you who is sending mail as your domain. If you're tightening your policy, use both.
How do I connect Fare to Claude?
Add the MCP server with your key: claude mcp add --transport http fare https://api.fare.dev/mcp --header "Authorization: Bearer $FARE_KEY". Clients that support OAuth can sign in instead.