Cached entry count and size for a domain
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
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.
Query parameters
- domainstringrequiredquery
The domain name (for example
example.com). These endpoints take the domain as a query parameter rather than a path segment.
Responses
200Cache footprint.
Content type: application/json
- entriesinteger
Cached objects across all nodes.
- size_bytesinteger
Their total size in bytes.
- nodesarray of CacheNodeTotal
Per-node figures; the totals are their sum. Absent when there is nothing to break down.
Item fields
- nodestring
- entriesinteger
- size_bytesinteger
- partialboolean
Present (
true) when a storage node did not answer, so the totals are a lower bound.
{
"entries": 0,
"size_bytes": 0,
"nodes": [
{
"node": "string",
"entries": 0,
"size_bytes": 0
}
],
"partial": true
}400The domain query parameter is missing.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "domain is required"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}Example request
curl -X GET "https://api.nsin.ir/cache/stats/?domain=example.com" \
-H "Authorization: Bearer $NSIN_API_KEY"