Email‑security grade
Send a domain and get an A to F grade for its SPF, DKIM and DMARC records, with the exact DNS change that fixes each problem.
GET https://api.fare.dev/v1/email-grade
Request
Send your key in the X-API-Key header. Pass the domain as a query parameter.
| Name | Required | What it is |
|---|---|---|
| domain | Yesrequired | The domain to grade, like example.com. Send internationalised domains in punycode (xn--) form. |
| selector | Nooptional | A DKIM selector to check. Without one, we try the common selectors: google, selector1, selector2, default, k1, s1, s2, dkim, mail, smtp, fm1, fm2, fm3, protonmail, protonmail2, protonmail3, sig1, hs1, hs2, s1024 and s2048. |
Try it
Each successful call costs 0.5¢. A call that fails isn't billed.
curl "https://api.fare.dev/v1/email-grade?domain=example.com" \
-H "X-API-Key: $FARE_KEY"
{
"domain": "example.com",
"grade": "C",
"score": 60,
"spf": { "status": "pass", "points": 25, "max_points": 30,
"record": "v=spf1 include:_spf.example.net ~all" },
"dmarc": { "status": "warn", "points": 15, "max_points": 50,
"record": "v=DMARC1; p=none; rua=mailto:dmarc@example.com" },
"dkim": { "status": "pass", "points": 20, "max_points": 20 },
"accepts_mail": true,
"fixes": [
"`p=none` only monitors. Move to `p=quarantine`, then `p=reject`, once reports look clean."
]
}
What you get back
| Field | What it is |
|---|---|
| grade | A, B, C, D or F. |
| score | 0 to 100. SPF is worth 30, DMARC 50 and DKIM 20. |
| spf, dmarc, dkim | Each has a status (pass, warn, fail or unknown), points, max_points, the record we found, and notes. |
| mx | The domain's mail servers. |
| accepts_mail | true if the domain has a mail server that isn't a null MX. |
| fixes | What to change, most important first. |
How the grade works
| Grade | Score |
|---|---|
| A | 90 or more |
| B | 75 to 89 |
| C | 60 to 74 |
| D | 40 to 59 |
| F | Under 40 |
| Check | Points |
|---|---|
| SPF | Up to 30: -all 30, ~all 25, ?all 10, +all 0. A redirect= is graded on its target's all. |
| DMARC | Up to 50: p=reject 50, p=quarantine 40, p=none 15. Less for pct under 100, sp=none or no rua. |
| DKIM | Up to 20: a key found 20. None found at the common selectors 10, marked unknown; a revoked key there counts the same. A missing or revoked key at the selector you name 0. |
Errors
| Status | Code | Message |
|---|---|---|
| 400 | invalid_domain | domain must be a hostname like example.com |
| 400 | invalid_selector | selector must be letters, digits, hyphens, underscores or dots |
| 502 | dns_failed | DNS lookup failed; try again shortly. |
| 401 | missing_key | Send your API key in the X-API-Key header. |
| 401 | invalid_key | That API key is not valid. |
| 402 | payment_required | Add a card at https://fare.dev/app/billing to use this key. |
| 429 | rate_limited | This key allows 10 requests per second. |
None of these are billed. Branch on the code, not the message: codes never change meaning within /v1.
For agents
The MCP tool grade_email_security takes a domain and an optional selector. It runs this same call on the key your agent connects with, and it's billed the same way.
claude mcp add --transport http fare https://api.fare.dev/mcp