Skip to main content

SPF Check API

free
GET/v1/security/spf

SPF 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 Administrator

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.

Security Engineer

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.

Marketing Operations

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.

IT Manager

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

NameLocationTypeRequiredDescription
domainquerystringRequiredThe 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.

FieldTypeDescription
domainstringThe queried domain
spf.foundbooleanWhether an SPF record exists
spf.recordstringRaw SPF record value
spf.validbooleanWhether the SPF record is syntactically valid
spf.versionstringSPF version (v=spf1)
spf.mechanismsarrayParsed SPF mechanisms with qualifier, type, value, and meaning
spf.includesarrayIncluded domains (include: mechanisms)
spf.all_qualifierstringDefault policy qualifier: +all, ~all, -all, or ?all
spf.all_meaningstringHuman-readable policy description
spf.dns_lookup_countnumberTotal DNS lookups required (max 10 per RFC 7208 §4.6.4)
spf.exceeds_dns_limitbooleanWhether the record exceeds the 10-lookup MUST limit
spf.void_lookup_countnumberNumber of NXDOMAIN or empty DNS responses encountered during recursive expansion (RFC 7208 §4.6.4 SHOULD limit is 2)
spf.exceeds_void_limitbooleanWhether void lookups exceed 2 — Google and Microsoft enforce this even when total lookups stay under 10
spf.authorized_ipv4_countnumberUnique IPv4 CIDRs / literals authorized to send mail after full include expansion (deduplicated)
spf.authorized_ipv6_countnumberUnique IPv6 CIDRs / literals authorized to send mail after full include expansion (deduplicated)
spf.dnssec_validatedbooleanWhether the apex SPF TXT lookup carried the DNSSEC AD bit
scorenumberSecurity score 0–100
gradestringLetter grade A–F based on score
recommendationsarraySpecific improvement recommendations
dns_errorobject|nullDNS 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
curl --request GET 'https://api.edgedns.dev/v1/security/spf?domain=google.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
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);
Python
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.

Try This Endpoint

Test the SPF Check endpoint live in the playground.

SPF Check API Reference | EdgeDNS