DKIM key lookup
POST /api/dkim-lookupFetch and parse a DKIM public-key record at <selector>._domainkey.<domain> (RFC 6376). Send POST /api/dkim-lookup with the required fields domain and selector and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with domain, selector, fullName, hasRecord, raw and 7 more.
Returns the parsed key params (algorithm, length, flags) so you can verify rotation status or key strength. Caller must know the selector - use email-deliverability if you don't.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | yes | Domain name (also accepts email/url/host) Also accepted as host, hostname, site. |
selector | string | yes | DKIM selector, e.g. "default", "google", "selector1" |
Example request
curl -i -X POST https://agent402.tools/api/dkim-lookup \
-H "Content-Type: application/json" \
-d '{"domain":"google.com","selector":"20221208"}'
Without payment this returns HTTP 402 Payment Required with the exact price for dkim-lookup; any x402 v2 or MPP client pays it and retries.
Example response
{
"domain": "google.com",
"selector": "20221208",
"fullName": "20221208._domainkey.google.com",
"hasRecord": true,
"raw": "v=DKIM1; k=rsa; p=MIIBIj...",
"version": "DKIM1",
"keyType": "rsa",
"hashAlgorithms": [],
"serviceType": "*",
"flags": [],
"publicKey": {
"base64": "MIIBIj...",
"bits": 2048,
"revoked": false
},
"warnings": []
}
| Field | Type | Always present | In the example |
|---|---|---|---|
domain | string | yes | google.com |
selector | string | yes | 20221208 |
fullName | string | yes | 20221208._domainkey.google.com |
hasRecord | boolean | yes | true |
raw | string | yes | v=DKIM1; k=rsa; p=MIIBIj... |
version | string | yes | DKIM1 |
keyType | string | yes | rsa |
hashAlgorithms | array | yes | 0 items in the example |
serviceType | string | yes | * |
flags | array | yes | 0 items in the example |
publicKey | object | yes | 3 fields: base64, bits, revoked |
warnings | array | yes | 0 items in the example |
From an MCP client
catalog.call {
"slug": "dkim-lookup",
"params": {
"domain": "google.com",
"selector": "20221208"
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for dkim-lookup; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
domainandselectorare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/dkim-lookup returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/dkim-lookup", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"domain": "google.com",
"selector": "20221208"
}),
});
Part of these workflows
DKIM key lookup is one step in these 2 skill packs, each sold as a single call:
- Email deliverability - Diagnose why a domain's email lands in spam: SPF posture, DMARC policy, DKIM key strength, MX targets, and a composite 0–100 score.
- Email security - Full email auth posture: SPF, DMARC, DKIM, and composite deliverability score in one call.
Related tools
DMARC check
POST /api/dmarc-checkFetch and validate a domain's DMARC policy at _dmarc.<domain> (RFC 7489). Surfaces the enforcement policy (none/quaranti…
Email deliverability check
POST /api/email-deliverabilityEnd-to-end email-auth report for a domain: SPF + DMARC + DKIM (probes common selectors automatically) + MX records + sco…
SPF check
POST /api/spf-checkFetch and validate a domain's SPF record (RFC 7208). Parses mechanisms (ip4/ip6/include/a/mx/all), counts DNS lookups ag…
Domain security & deliverability audit (graded)
POST /v1/domain-auditHand over a domain and get one graded security & email-deliverability audit: SPF, DMARC, DKIM and MX (why your mail land…
DNS lookup
GET /api/dnsLive DNS lookup for a domain: returns name, type and records[]. Supported record types: A, AAAA (addresses as strings), …
DNS lookup
POST /api/dns-lookupResolve any DNS record type for a host: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR. Returns the records plus a coun…