API documentation

Reference for the DNSRift JSON API. New here? Start with the API overview.

Quick start

Base URLhttps://api.dnsrift.net
MethodGET
FormatJSON (UTF-8)
Free quota15,000 / day
bash
curl -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.

bash
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.

GET
https://api.dnsrift.net/reverse-ip-lookup?ip=8.8.8.8

Parameters

ParameterTypeRequiredDescription
ipstringYesIPv4 or IPv6 address. Any valid spelling is accepted (e.g. 2001:DB8:0:0::1, [2001:db8::1], ::ffff:8.8.8.8).
limitintegerNoMaximum results to return. Missing, zero or invalid means the plan maximum; larger values are capped to it.
keystringNoAPI key for paid plans. Prefer the X-API-Key header (keeps the key out of URLs and logs).

Response fields

FieldTypeDescription
ipstringThe address as you sent it.
planstringfree, professional or enterprise.
domain_countintegerNumber of items in domain_list.
max_resultsinteger | "unlimited"Highest limit your plan allows.
limitintegerLimit applied to this request.
domain_liststring[]Domains hosted on the IP.
countintegerSame as domain_count (also present on the subdomain endpoint).
ip_normalizedstringCanonical form of the address that was searched (RFC 5952 for IPv6).
200 OK
{
  "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).

GET
https://api.dnsrift.net/subdomain-lookup?domain=example.com

Parameters

ParameterTypeRequiredDescription
domainstringYesDomain name, e.g. example.com. Case and a trailing dot are ignored; IDNs in punycode (xn--) are accepted.
limitintegerNoMaximum results to return. Missing, zero or invalid means the plan maximum; larger values are capped to it.
keystringNoAPI key for paid plans. Prefer the X-API-Key header (keeps the key out of URLs and logs).

Response fields

FieldTypeDescription
target_domainstringThe domain that was searched (lowercase).
planstringfree, professional or enterprise.
countintegerNumber of items in subdomains.
max_resultsinteger | "unlimited"Highest limit your plan allows.
limitintegerLimit applied to this request.
subdomainsstring[]Subdomains of the target domain.
200 OK
{
  "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 IPSubdomains
Searched valueip (+ ip_normalized)target_domain
List of resultsdomain_listsubdomains
Number of resultsdomain_count and countcount

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.

HTTPerrorWhenmessage
400missing_parameterThe ip or domain parameter is missing or empty.Missing ip parameter
400invalid_inputThe value is longer than 64 characters (ip) or 253 characters (domain).Invalid input
400invalid_ipNot a valid IPv4 or IPv6 address.Invalid IP format
400invalid_domainNot a valid domain name.Invalid domain format
401invalid_api_key_formatThe key does not look like a DNSRift key (dnsrift_ followed by 48 hex characters).Invalid API key format
401invalid_api_keyNo active key matches. Check for copy errors, or regenerate it in the dashboard.Invalid API key
403api_key_expiredThe plan for this key has ended. The body includes upgrade_url.API key expired
405method_not_allowedOnly GET (and HEAD / OPTIONS) are accepted.Method not allowed
429rate_limit_exceededPlan quota used up. See Retry-After, reset_at, retry_after and detail.Rate limit exceeded
429burst_limitedToo many requests per second from one client. Wait a second and retry.Too many requests per second. Slow down and retry.
500internal_errorUnexpected server error. Quote request_id (also in the X-Request-Id header) to support.Internal error
503backend_unavailableThe database is briefly unavailable. Retry after the Retry-After header (5 s).Lookup temporarily unavailable, please retry
400 Bad Request
{
  "domain_list": [],
  "message": "Invalid IP format",
  "error": "invalid_ip"
}
500 Internal Server Error
{
  "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

PlanRequestsPeriodResults per requestAPI key
Free15,000per day, resets 00:00 UTC100,000Not needed
Professional1,000,000per 30 days (rolling)500,000Required
Enterprise3,000,000per 30 days (rolling)UnlimitedRequired

Every successful response carries these headers:

Response 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:

429 Too Many Requests
{
  "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

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

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

bash
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.