SPF Check API
free/v1/security/spfSPF syntax and bounded static dependency analysis with fatal/advisory distinction, RFC DNS-term counts, resolver transaction/void budgets and explicit incomplete states. This configuration evidence does not evaluate a specific sender message or prove its effective authorization surface.
What It Does
Validates ordered mechanisms and address/CIDR/modifier syntax, follows applicable include/redirect dependencies and A/MX/exists lookups under resource bounds, and propagates nested invalid records or DNS failures. Initial TXT is not a counted SPF mechanism; actual DNS queries are separate from the ten-term limit. Positive candidate address references are diagnostic; qualifiers, earlier matches, sender family and runtime macros can change authorization. Unavailable/partial analyses are not cached as absent policies.
Why It's Useful
Use source-scoped configuration evidence to investigate policy gaps and compare equivalent observations. This diagnostic does not prove actual message authentication, provider disposition or a complete sender inventory; review standards profile, coverage and limitations before acting.
Use Cases
Email Deliverability Troubleshooting
Emails are being rejected or landing in spam. Verify the SPF record is syntactically valid, under the 10-lookup limit, and uses an appropriate policy qualifier.
Identify and fix SPF issues causing email rejection or spam classification.
Email Security Audit
Audit organization domains to ensure SPF records use strict policies (-all) and don't include unnecessary third-party services that expand the attack surface.
Reduce email spoofing risk with properly hardened SPF configuration.
Third-Party Sender Authorization
After adding a new email marketing platform (Mailchimp, SendGrid, HubSpot), verify the SPF record includes the new sender and hasn't exceeded the DNS lookup limit.
Ensure marketing emails authenticate properly after platform changes.
Bulk Sender Compliance
Verify SPF compliance with Google/Yahoo/Microsoft bulk sender requirements (2024-2025) that mandate valid SPF records for domains sending 5,000+ emails/day. Non-compliant emails face rejection starting November 2025 (Gmail) and May 2025 (Outlook).
Maintain email deliverability to Gmail, Yahoo, and Outlook recipients.
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
domain | query | string | Required | The domain to check SPF records forExample: google.com |
Response Fields
Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain |
spf.found | boolean | Whether an SPF record exists |
spf.record | string | Raw SPF record value |
spf.valid | boolean | Whether the SPF record is syntactically valid |
spf.version | string | SPF version (v=spf1) |
spf.mechanisms | array | Parsed SPF mechanisms with qualifier, type, value, and meaning |
spf.includes | array | Included domains (include: mechanisms) |
spf.all_qualifier | string | Default policy qualifier: +all, ~all, -all, or ?all |
spf.all_meaning | string | Human-readable policy description |
spf.dns_lookup_count | number | Total DNS lookups required (max 10 per RFC 7208 §4.6.4) |
spf.exceeds_dns_limit | boolean | Whether the record exceeds the 10-lookup MUST limit |
spf.void_lookup_count | number | Number of NXDOMAIN or empty DNS responses encountered during recursive expansion (RFC 7208 §4.6.4 SHOULD limit is 2) |
spf.exceeds_void_limit | boolean | Whether void lookups exceed 2 — Google and Microsoft enforce this even when total lookups stay under 10 |
spf.authorized_ipv4_count | number | Unique IPv4 CIDRs / literals authorized to send mail after full include expansion (deduplicated) |
spf.authorized_ipv6_count | number | Unique IPv6 CIDRs / literals authorized to send mail after full include expansion (deduplicated) |
spf.dnssec_validated | boolean | Whether the apex SPF TXT lookup carried the DNSSEC AD bit |
score | number | Security score 0–100 |
grade | string | Letter grade A–F based on score |
recommendations | array | Specific improvement recommendations |
dns_error | object|null | DNS lookup error details when available; distinguish failure from an absent SPF record. |
Code Examples
Replace YOUR_API_KEY with your API key. This endpoint requires the free plan or higher; see plans and usage limits.
curl --request GET 'https://api.edgedns.dev/v1/security/spf?domain=google.com' \
--header "Authorization: Bearer YOUR_API_KEY"const response = await fetch(
"https://api.edgedns.dev/v1/security/spf?domain=google.com",
{
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
);
if (!response.ok) {
throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);import requests
response = requests.request(
'GET',
"https://api.edgedns.dev/v1/security/spf?domain=google.com",
headers={'Authorization': 'Bearer YOUR_API_KEY'},
timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)Read the full SPF Check guide
Learn the concepts, choose a practical workflow, and interpret the observations from SPF Check before acting on them. Run supported checks via MCP or through REST.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.