Developer resource
Domain Security API Documentation
Check SPF, DKIM, DMARC, MX records and nameserver configuration for a domain from your own scripts. The API is part of DomainGuard Pro and Enterprise, and it uses an API key you create in the dashboard.
Read access is included with Pro. Enterprise adds the write scope and the MCP server.
Quick Start
# Example request
curl -H "Authorization: Bearer nhm_your_key" "https://nhmohio.com/api/?domain=example.com"Base URL
https://nhmohio.com/api/Method
GETAn API key is required
Send it as Authorization: Bearer nhm_…. Create a key under API Keys in your dashboard. Keys are available on Pro and Enterprise; the plan is checked on every request, so a key stops working if the plan lapses. Each key is scoped to the resources you pick and rate limited per hour. Without a key these endpoints answer 401.
This API was open to anyone until 26 August 2026. It now needs an account because every call runs a real scan against live DNS and TLS. Scanning from the website stays free with a free account; it is scripted access that needs a paid plan.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | The domain name to check (e.g., example.com) |
Domain Format
Pass only the domain name without protocol or path. Use example.com not https://example.com or www.example.com.
Response Format
The API returns a JSON object with the following structure:
{
"success": true,
"domain": "example.com",
"records": {
"spf": {
"status": "ok" | "missing" | "error",
"record": "v=spf1 include:_spf.google.com ~all",
"issues": ["Optional array of detected issues"]
},
"dkim": {
"status": "ok" | "missing" | "error",
"record": "v=DKIM1; k=rsa; p=...",
"issues": []
},
"dmarc": {
"status": "ok" | "missing" | "error",
"record": "v=DMARC1; p=reject; ...",
"issues": []
},
"mx": {
"status": "ok" | "missing",
"records": [
{ "priority": 1, "exchange": "aspmx.l.google.com" },
{ "priority": 5, "exchange": "alt1.aspmx.l.google.com" }
],
"issues": [],
"isMicrosoft365": false,
"isGoogleWorkspace": true
},
"nameservers": {
"status": "found" | "error",
"nameservers": [
{ "nameserver": "ns1.example.com", "provider": "Cloudflare" }
],
"provider": {
"name": "Cloudflare",
"url": "https://dash.cloudflare.com"
},
"issues": []
}
},
"summary": {
"issues": ["Array of overall issues found"]
}
}Response Fields
success
Boolean indicating whether the API request was successful. Check this first before processing results.
records.spf
SPF (Sender Policy Framework) record information. The status field indicates if SPF is properly configured.
records.dkim
DKIM (DomainKeys Identified Mail) record information. Checks common selectors like default, google, selector1, and selector2.
records.dmarc
DMARC (Domain-based Message Authentication) record information. Includes policy analysis and configuration recommendations.
records.mx
MX (Mail Exchange) records with priority values. Includes detection for common email providers like Microsoft 365 and Google Workspace.
records.nameservers
Nameserver information with provider detection. Includes direct links to DNS management portals when available.
Status Values
Record is properly configured and no issues were detected.
Record exists but has configuration issues that should be addressed.
Record is not configured. This typically requires action.
Code Examples
cURL
curl -H "Authorization: Bearer nhm_your_key" \ "https://nhmohio.com/api/?domain=example.com"
JavaScript / TypeScript
const response = await fetch(
"https://nhmohio.com/api/?domain=example.com",
{ headers: { Authorization: `Bearer ${process.env.NHM_API_KEY}` } }
);
const data = await response.json();
if (data.success) {
console.log("SPF Status:", data.records.spf.status);
console.log("DKIM Status:", data.records.dkim.status);
console.log("DMARC Status:", data.records.dmarc.status);
}Python
import os
import requests
response = requests.get(
"https://nhmohio.com/api/",
params={"domain": "example.com"},
headers={"Authorization": f"Bearer {os.environ['NHM_API_KEY']}"},
)
data = response.json()
if data["success"]:
print(f"SPF: {data['records']['spf']['status']}")
print(f"DKIM: {data['records']['dkim']['status']}")
print(f"DMARC: {data['records']['dmarc']['status']}")PHP
$domain = "example.com";
$url = "https://nhmohio.com/api/?domain=" . urlencode($domain);
$context = stream_context_create(["http" => [
"header" => "Authorization: Bearer " . getenv("NHM_API_KEY"),
]]);
$response = file_get_contents($url, false, $context);
$data = json_decode($response, true);
if ($data["success"]) {
echo "SPF: " . $data["records"]["spf"]["status"] . "\n";
echo "DKIM: " . $data["records"]["dkim"]["status"] . "\n";
echo "DMARC: " . $data["records"]["dmarc"]["status"] . "\n";
}Use Cases
AI Assistants & Chatbots
Integrate domain security checks into AI tools and chatbots to help users diagnose email delivery issues.
Security Audits
Automate email security audits by checking multiple domains programmatically.
IT Management Tools
Build monitoring dashboards to track email authentication status across client domains.
Email Deliverability
Diagnose why emails are landing in spam by checking sender authentication records.
Talk directly with the owner
Need help with email security?
Our team can help you configure SPF, DKIM, and DMARC records correctly for your domain.
