Skip to content
nsin docs

Cached entry count and size for a domain

GET
/cache/stats/
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.

domain
required
string

The domain name (for example example.com). These endpoints take the domain as a query parameter rather than a path segment.

Example
example.com

Cache footprint.

Media type application/json
object
entries

Cached objects across all nodes.

integer
size_bytes

Their total size in bytes.

integer
nodes

Per-node figures; the totals are their sum. Absent when there is nothing to break down.

Array<object>
object
node
string
entries
integer
size_bytes
integer
partial

Present (true) when a storage node did not answer, so the totals are a lower bound.

boolean
Example generated
{
"entries": 1,
"size_bytes": 1,
"nodes": [
{
"node": "example",
"entries": 1,
"size_bytes": 1
}
],
"partial": true
}

The domain query parameter is missing.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example missing
{
"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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}