Cached entry count and size for a domain
const url = 'https://api.nsin.ir/cache/stats/?domain=example.com';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/cache/stats/?domain=example.com' \ --header 'Authorization: Bearer <token>'The domain’s live cache footprint, as reported by every storage node
and summed, with the per-node breakdown. Results are cached briefly, so
a purge can take a few seconds to show up here. When a node does not
answer (or none is configured) the figures are a floor and partial is
true — “0 bytes” then does not mean an empty cache. Requires
domain.view.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The domain name (for example example.com). These endpoints take the
domain as a query parameter rather than a path segment.
Example
example.comResponses
Section titled “ Responses ”Cache footprint.
object
Cached objects across all nodes.
Their total size in bytes.
Per-node figures; the totals are their sum. Absent when there is nothing to break down.
object
Present (true) when a storage node did not answer, so the totals are a lower bound.
Example generated
{ "entries": 1, "size_bytes": 1, "nodes": [ { "node": "example", "entries": 1, "size_bytes": 1 } ], "partial": true}The domain query parameter is missing.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "domain is required"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
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"}