DMARC record parser API
Reads one DMARC record as text with the DMARC check's rules (RFC 9989): p, sp, np, psd, t, adkim, aspf, rua and ruf, historic and unknown tags. Nothing is looked up, so which record applies to a domain and external report destinations are not checked.
POST https://api.lookproof.dev/v1/mail/dmarc-parse
Updated 2026-10-09
Examples use the Base (eip155:8453) network.
Input
A JSON body with content-type: application/json.
| Name | Type | Required | Limits | Description |
|---|---|---|---|---|
record | string | Yes | 1–4096 characters | The DMARC record text, starting with v=DMARC1. |
Example request
curl -i -X POST https://api.lookproof.dev/v1/mail/dmarc-parse \
-H 'content-type: application/json' \
-d '{"record": "v=DMARC1; p=quarantine; rua=mailto:[email protected]; adkim=s"}'import asyncio
import os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import register_exact_evm_client
async def main() -> None:
signer = EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"]))
client = register_exact_evm_client(x402Client(), signer, networks="eip155:8453")
async with x402HttpxClient(client) as http:
response = await http.post('https://api.lookproof.dev/v1/mail/dmarc-parse', json={'record': 'v=DMARC1; p=quarantine; rua=mailto:[email protected]; adkim=s'})
response.raise_for_status()
print(response.json())
asyncio.run(main())
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});
const response = await fetchWithPayment("https://api.lookproof.dev/v1/mail/dmarc-parse", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"record": "v=DMARC1; p=quarantine; rua=mailto:[email protected]; adkim=s"}),
});
console.log(await response.json());
curl: unpaid request — returns 402 with the price (PAYMENT-REQUIRED). The Python and JavaScript clients pay it and send the request again. Only ordinary wallets (EOA) can pay; smart-contract wallets get a 402 without charge. See payments.
Example response
{
"checked_at": "2026-10-24T12:00:00Z",
"data": {
"adkim": "s",
"aspf": "r",
"is_dmarc": true,
"nonexistent_policy": "quarantine",
"notes": [
"The policy shown is the record's own p=; for a subdomain the sp= or np= value can apply instead. The DMARC check on a domain decides which record and policy apply.",
"Whether a report address in another domain accepts reports (RFC 9989 external destination verification) needs DNS and is not checked."
],
"pct": 100,
"policy": "quarantine",
"psd": null,
"record": "v=DMARC1; p=quarantine; rua=mailto:[email protected]; adkim=s",
"rua": [
"mailto:[email protected]"
],
"ruf": [],
"subdomain_policy": "quarantine",
"tags": [
{
"name": "v",
"value": "DMARC1"
},
{
"name": "p",
"value": "quarantine"
},
{
"name": "rua",
"value": "mailto:[email protected]"
},
{
"name": "adkim",
"value": "s"
}
],
"test_mode": false,
"unknown_tags": []
},
"endpoint": "mail.dmarc_parse",
"findings": [],
"meta": {
"cache_hit": false,
"duration_ms": 42,
"fresh_until": "2026-10-24T12:05:00Z",
"observed_at": "2026-10-24T12:00:00Z",
"resolver": null,
"source": "offline"
},
"request_id": "req_aaaaaaaaaaaaaaaaaaaaaaaaaa",
"schema_version": "1.0",
"status": "ok"
}
Response fields
| Field | Meaning |
|---|---|
request_id | Unique id of this request. Quote it when you contact support. |
endpoint | The endpoint id, for example mail.spf. |
schema_version | Version of the response format, currently 1.0. |
checked_at | When the check ran (ISO 8601, UTC). |
status | ok, info, warning or error from the worst finding, or unknown when the check was incomplete. unknown is not an error in the domain. |
data | The check's own data. Its fields are listed below. |
findings | What was found: code, severity, message, explanation and evidence. |
meta | Duration, cache use, resolver and how long the result stays fresh. |
Fields in data
| Field | Type |
|---|---|
record | string |
is_dmarc | boolean |
policy | one of none, quarantine, reject or null |
subdomain_policy | one of none, quarantine, reject or null |
nonexistent_policy | one of none, quarantine, reject or null |
psd | one of y, n, u or null |
test_mode | boolean |
pct | integer or null |
adkim | one of r, s or null |
aspf | one of r, s or null |
rua | array of string |
ruf | array of string |
tags | array of Tag |
unknown_tags | array of string |
notes | array of string |
Status codes
| Status | Code | Meaning | Do you pay? |
|---|---|---|---|
| 200 | — | The result is delivered, also when it has negative findings. | Yes: charged once per payment; redelivery of the same payment is free |
| 402 | — | Payment is required, or the attached payment was refused. The body states the price. | No |
| 400 | bad_request | The request is malformed. | No |
| 409 | payment_in_progress, payment_bound_to_other_request | This payment is already being processed, or it is bound to a different request. No new payment is taken. | No |
| 413 | payload_too_large | The body is larger than 64 KB. | No |
| 422 | invalid_input | The input failed validation on a request that carries a payment; nothing is charged. Without a payment, invalid input gets a 402 whose error field names the problem. | No |
| 429 | rate_limited | Too many requests from this IP address or payer. | No |
| 502 | check_failed | The check could not be completed. | No |
| 503 | busy, unavailable, payments_unavailable | The service is busy or temporarily unavailable. | No |
| 504 | deadline_exceeded | The check ran out of time. | No |
Errors use the common error body. See errors.
Findings this endpoint can return
DMARC (9)
- Info
DMARC_HISTORIC_TAGThe DMARC record contains a tag that RFC 9989 lists as historic. - Error
DMARC_INVALID_POLICYThe DMARC record has an invalid p, sp or np tag. - Info
DMARC_NO_RUAThe DMARC record has no aggregate report address (rua). - Info
DMARC_PARTIAL_PCTThe DMARC record uses pct below 100, a tag that RFC 9989 removed. - Info
DMARC_POLICY_NONEThe DMARC policy is p=none (monitoring only). - Error
DMARC_SYNTAX_ERRORThe DMARC record contains a tag that cannot be parsed or has an invalid value. - Info
DMARC_TESTING_MODEThe DMARC policy is in testing mode (t=y). - Info
DMARC_UNKNOWN_TAGThe DMARC record contains tags that are not defined. - Info
DMARC_UNSUPPORTED_REPORT_URIA DMARC report address uses a scheme other than mailto.