SPF Check API - Parse Mechanisms and All Policy
Fetches TXT records for the domain and selects the one starting with v=spf1. Parses each mechanism (ip4, ip6, a, mx, include, all, etc.) with its qualifier (+, -, ~, ?). Returns the raw record, the parsed mechanisms, the resolved all-policy, and the list of include targets.
Code examples
curl -X POST https://api.botoi.com/v1/dns-security/spf-check \
-H "Content-Type: application/json" \
-d '{"domain":"stripe.com"}'When to use this API
Harden your SPF policy from ~all to -all
Check your production domain with this endpoint. If all_policy is ~all (softfail), you are still leaking legitimacy to spoofers. Tighten to -all (hardfail) only after confirming all legitimate senders are in your include list.
Audit third-party senders
Every include adds a DNS lookup budget under the 10-lookup SPF limit. List your includes and verify each one still represents an active sender; remove stale includes (old ESPs, deprecated services).
Pre-flight for email migrations
When switching email providers (Google Workspace to M365), confirm the old include is removed and the new one is added before flipping DNS. Prevents the 24-hour window where both providers partially pass SPF.
Frequently asked questions
What does the qualifier mean?
What is the SPF 10-lookup limit?
Why does has_spf return false when I have a TXT record?
What should all_policy be?
Does this follow include: chains?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.