Download one cached object
const url = 'https://api.nsin.ir/domains/example.com/cache/keys/content?hostname=example&node=example&key_hash=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nsin.ir/domains/example.com/cache/keys/content?hostname=example&node=example&key_hash=example' \ --header 'Authorization: Bearer <token>'The stored bytes behind a listing row, read straight from cache storage — your origin is never contacted, so this works even when the site is down.
Address the entry by its stored identity: copy hostname, node and
key_hash verbatim from a /domains/{domain}/cache/keys row. node is
the edge location that cached it, so the same URL cached at three
locations is three entries and you choose which copy you get.
The body is returned in its original uncompressed form with the stored
Content-Type, always as an attachment. The cached response’s own status
code and age travel in X-Nsin-Cache-Status and X-Nsin-Cached-At — the
HTTP status describes only whether the read succeeded.
A 404 with entry is no longer cached means the listing row outlived
the object (it expired, was evicted, or was purged). Requires
domain.view.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comQuery Parameters
Section titled “Query Parameters ”The row’s hostname — the storage namespace, not the request host.
The row’s node — the edge location holding this copy. Case-sensitive.
The row’s key_hash.
Responses
Section titled “ Responses ”The stored object. Content-Type is whatever was cached; the payload
is the uncompressed body.
Headers
Section titled “Headers ”Edge location this copy came from.
HTTP status of the cached response.
When the object was cached (RFC 3339).
Missing or malformed hostname, node or key_hash.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}Domain or hostname not yours, or the entry is no longer cached.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}The stored entry could not be decoded.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Cache storage is unavailable.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}