API documentation
Reference for the DNSRift JSON API. New here? Start with the API overview.
Quick start
https://api.dnsrift.netGETJSON (UTF-8)15,000 / daycurl -s "https://api.dnsrift.net/reverse-ip-lookup?ip=8.8.8.8&limit=10"
Authentication
The free plan needs no key: requests are counted per client IP address (per /64 network for IPv6). Paid plans use the key shown in your dashboard.
Send the key in the X-API-Key header (recommended). The key query parameter still works; if both are present, the header wins.
curl -s -H "X-API-Key: dnsrift_your_key_here" "https://api.dnsrift.net/subdomain-lookup?domain=example.com"
Browsers may call the API directly: CORS is open for GET, and the X-API-Key header is allowed. Keep paid keys server-side.
Reverse IP lookup
Domains whose DNS records point to an IP address.
https://api.dnsrift.net/reverse-ip-lookup?ip=8.8.8.8
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ip | string | Yes | IPv4 or IPv6 address. Any valid spelling is accepted (e.g. 2001:DB8:0:0::1, [2001:db8::1], ::ffff:8.8.8.8). |
limit | integer | No | Maximum results to return. Missing, zero or invalid means the plan maximum; larger values are capped to it. |
key | string | No | API key for paid plans. Prefer the X-API-Key header (keeps the key out of URLs and logs). |
Response fields
| Field | Type | Description |
|---|---|---|
ip | string | The address as you sent it. |
plan | string | free, professional or enterprise. |
domain_count | integer | Number of items in domain_list. |
max_results | integer | "unlimited" | Highest limit your plan allows. |
limit | integer | Limit applied to this request. |
domain_list | string[] | Domains hosted on the IP. |
count | integer | Same as domain_count (also present on the subdomain endpoint). |
ip_normalized | string | Canonical form of the address that was searched (RFC 5952 for IPv6). |
{
"ip": "8.8.8.8",
"plan": "free",
"domain_count": 2,
"max_results": 100000,
"limit": 100000,
"domain_list": ["dns.google", "example-resolver.net"],
"count": 2,
"ip_normalized": "8.8.8.8"
}
Subdomain lookup
Known subdomains of a domain, from passive DNS (no scanning).
https://api.dnsrift.net/subdomain-lookup?domain=example.com
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name, e.g. example.com. Case and a trailing dot are ignored; IDNs in punycode (xn--) are accepted. |
limit | integer | No | Maximum results to return. Missing, zero or invalid means the plan maximum; larger values are capped to it. |
key | string | No | API key for paid plans. Prefer the X-API-Key header (keeps the key out of URLs and logs). |
Response fields
| Field | Type | Description |
|---|---|---|
target_domain | string | The domain that was searched (lowercase). |
plan | string | free, professional or enterprise. |
count | integer | Number of items in subdomains. |
max_results | integer | "unlimited" | Highest limit your plan allows. |
limit | integer | Limit applied to this request. |
subdomains | string[] | Subdomains of the target domain. |
{
"target_domain": "example.com",
"plan": "free",
"count": 3,
"max_results": 100000,
"limit": 100000,
"subdomains": ["www.example.com", "mail.example.com", "blog.example.com"]
}
Field names differ between endpoints
The two endpoints were built at different times and existing clients depend on their field names, so they are kept as they are:
| Reverse IP | Subdomains | |
|---|---|---|
| Searched value | ip (+ ip_normalized) | target_domain |
| List of results | domain_list | subdomains |
| Number of results | domain_count and count | count |
Use count if you want one field name for both. Error bodies always contain the endpoint's list field (empty), so code that reads the list never breaks.
Errors
Errors are JSON with the endpoint's empty list field, a human-readable message and a stable error code. Branch on error, not on the message text.
| HTTP | error | When | message |
|---|---|---|---|
| 400 | missing_parameter | The ip or domain parameter is missing or empty. | Missing ip parameter |
| 400 | invalid_input | The value is longer than 64 characters (ip) or 253 characters (domain). | Invalid input |
| 400 | invalid_ip | Not a valid IPv4 or IPv6 address. | Invalid IP format |
| 400 | invalid_domain | Not a valid domain name. | Invalid domain format |
| 401 | invalid_api_key_format | The key does not look like a DNSRift key (dnsrift_ followed by 48 hex characters). | Invalid API key format |
| 401 | invalid_api_key | No active key matches. Check for copy errors, or regenerate it in the dashboard. | Invalid API key |
| 403 | api_key_expired | The plan for this key has ended. The body includes upgrade_url. | API key expired |
| 405 | method_not_allowed | Only GET (and HEAD / OPTIONS) are accepted. | Method not allowed |
| 429 | rate_limit_exceeded | Plan quota used up. See Retry-After, reset_at, retry_after and detail. | Rate limit exceeded |
| 429 | burst_limited | Too many requests per second from one client. Wait a second and retry. | Too many requests per second. Slow down and retry. |
| 500 | internal_error | Unexpected server error. Quote request_id (also in the X-Request-Id header) to support. | Internal error |
| 503 | backend_unavailable | The database is briefly unavailable. Retry after the Retry-After header (5 s). | Lookup temporarily unavailable, please retry |
{
"domain_list": [],
"message": "Invalid IP format",
"error": "invalid_ip"
}
{
"subdomains": [],
"message": "Internal error",
"error": "internal_error",
"request_id": "3f9ea9c41dc0"
}
Two responses come from the web server rather than the API and have a shorter body: an unknown path returns 404 {"error":"Endpoint not found"}, and a blocked client returns 403 {"error":"Access denied"}.
Rate limits
| Plan | Requests | Period | Results per request | API key |
|---|---|---|---|---|
| Free | 15,000 | per day, resets 00:00 UTC | 100,000 | Not needed |
| Professional | 1,000,000 | per 30 days (rolling) | 500,000 | Required |
| Enterprise | 3,000,000 | per 30 days (rolling) | Unlimited | Required |
Every successful response carries these headers:
X-RateLimit-Plan: free
X-RateLimit-Limit: 15000
X-RateLimit-Remaining: 14842
X-RateLimit-Reset: 1767312000
X-Result-Limit: 100000
X-Request-Id: 3f9ea9c41dc0
X-RateLimit-Reset is the Unix time of the next 00:00 UTC. On the free plan the whole quota comes back then; on paid plans that is when the oldest day leaves the rolling 30-day window. When the quota is used up:
{
"domain_list": [],
"message": "Rate limit exceeded",
"error": "rate_limit_exceeded",
"plan": "free",
"limit": 15000,
"used": 15000,
"period": "day",
"upgrade_url": "https://dnsrift.net/pricing",
"reset_at": "2026-01-02T00:00:00Z",
"retry_after": 3600,
"detail": "Free plan limit of 15,000 requests per day reached. It resets at 2026-01-02T00:00:00Z (00:00 UTC). Upgrade at https://dnsrift.net/pricing"
}
For paid plans period is "month", kept for compatibility: the window is a rolling 30 days. Plans and prices: pricing.
Code examples
Python
import requests
r = requests.get("https://api.dnsrift.net/reverse-ip-lookup",
params={"ip": "8.8.8.8", "limit": 1000},
headers={"X-API-Key": "dnsrift_your_key_here"}, # omit for the free plan
timeout=30)
data = r.json()
if r.status_code == 429:
print("Limit reached, retry after", r.headers.get("Retry-After"), "seconds")
elif r.ok:
for domain in data["domain_list"]:
print(domain)
else:
print(r.status_code, data.get("error"), data.get("message"))
JavaScript
const res = await fetch("https://api.dnsrift.net/subdomain-lookup?domain=example.com");
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data.count, data.subdomains);
cURL + jq
curl -s "https://api.dnsrift.net/subdomain-lookup?domain=example.com" | jq -r '.subdomains[]'
FAQ
Do I need an API key?
No, not for the free plan: 15,000 requests per day, counted per IP address (per /64 network for IPv6). Paid plans use a dedicated key sent in the X-API-Key header.
When does the free quota reset?
Every day at 00:00 UTC. Paid plans are counted over a rolling 30-day window.
What happens when I reach a limit?
You get HTTP 429 with error "rate_limit_exceeded", a Retry-After header, and reset_at / retry_after fields in the body. Nothing is billed automatically.
Why do the two endpoints name their fields differently?
For compatibility with existing clients. Both endpoints also return "count", so new code can use the same field for both.
Still stuck? Telegram support.