subnethistory docs
Open the appApp
API reference/API overview

API overview

Base URL, authentication, rate limits, common parameters and errors.

Everything the website shows is available as JSON.

base url
https://subnethistory.com/api/v1

All endpoints are HTTP GET and return JSON, except the streaming lookup, which returns server sent events. Responses are UTF-8.

Authentication

None. The API is currently open and requires no key or account. If you plan sustained high volume use, contact [email protected] first.

Rate limits

Requests are limited to 120 per minute per client IP. Exceeding the limit returns HTTP 429 with rate limit headers; back off until the window resets. The health check and the font and flag assets are exempt; everything else counts.

!

Cold lookups are expensive for the service even when they are free for you. If you are enriching a list of addresses, spread the requests out rather than bursting, and reuse the cached results your earlier requests created.

CORS

Cross origin requests are allowed from any origin, so the API can be called directly from browser applications.

Common query parameters

These apply to the lookup endpoints (/lookup, /lookup/stream, /ip/…, /prefix/…, /asn/…, /history).

ParameterValuesMeaning
qan IP, CIDR prefix or AS numberThe query, on endpoints that take one. Same formats as the search bar.
shallow1Skip the second enrichment pass. Faster, but ASN level detail discovered from the first pass may be missing.
offline1Answer from cache only. Nothing is fetched upstream.
refresh1Force upstream refetch, bypassing the cache. Reserved for operators; without authorisation the parameter is ignored and the request is served normally.

Errors

StatusWhenBody
400The query could not be interpreted, or a required parameter is missing{ "error" }, plus a hint for unparseable queries
404Unknown API path{ "error": "not found" }
429Rate limit exceededStandard rate limit error body
502The lookup itself failed unexpectedly{ "error": "lookup failed", "detail" }

An upstream outage alone never fails your request: the affected dataset is reported with a stale or error state in sources and the rest of the report is delivered. A stale dataset still has an answer, the last known good one, so it does not set meta.partial. An error dataset has none, so it does, and meta.retryAfterMs says how long to wait before repeating the lookup. A 502 means the lookup pipeline itself hit an unexpected error (the history endpoint reports the same condition as a plain 500).

Example 400 response:

json
{
  "error": "could not interpret \"hello\" as an IP address, CIDR prefix, or AS number",
  "hint": "Try an IP address (8.8.8.8), a CIDR prefix (8.8.8.0/24), or an AS number (AS15169)."
}

Versioning

The API is versioned in the path (/api/v1). Changes within v1 are additive: new fields may appear in responses at any time, so clients should ignore fields they do not recognise.

Endpoints

EndpointReturns
GET /lookupThe full report, for any query. Also reachable as /ip/…, /prefix/…, /asn/….
GET /lookup/streamThe same lookup as server sent events with live progress.
GET /asn/:asn/neighboursPaged neighbour lists for an AS.
GET /asn/:asn/prefixesPaged announced prefix lists for an AS.
GET /historyTimeline, insights, sources and meta, without the rest of the report.
GET /archiveSubnetHistory's own recorded change events and routing observations.
GET /sourcesThe credited data sources, machine readable.
GET /tagsThe full tag vocabulary.
GET /recentThe latest searches across the site.
GET /whoamiThe IP your request arrived from.
Last updated 2026-08-15subnethistory.com