Account-wide summary
const url = 'https://api.nsin.ir/analytics/global-summary?period=1h';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/analytics/global-summary?period=1h' \ --header 'Authorization: Bearer <token>'Headline figures — requests, bandwidth, unique visitors, error rate and
cache hit rate — aggregated across every active domain you can access.
The peak requests-per-second figure is a separate, on-demand call:
GET /analytics/global-summary/peak.
Besides the usual periods, all covers the whole retained history.
Answers are cached per account: for 1–10 minutes depending on the
period, and for a day with all.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Time window, ending now — the values of the shared period
parameter, plus all for the whole retained history. An
unrecognised value falls back to 24h.
Responses
Section titled “ Responses ”Account-wide totals.
object
Bytes.
Share of requests that failed, 0–1.
Share of cacheable requests served from cache, 0–1.
How many domains contributed.
Example generated
{ "total_requests": 1, "total_bandwidth": 1, "unique_visitors": 1, "error_rate": 1, "cache_hit_rate": 1, "domains": 1}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"}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"}Either the analytics backend is temporarily unreachable (retry; no data
is lost), or the answer is still being computed. The per-domain
sections and the cached account-wide views (domains-overview,
global-summary, global-summary/peak, requests-compare,
bandwidth-overview, nodes-overview) wait at most about 25 seconds
for their query; past that they answer 503 with pending: true and
a Retry-After header, while the query keeps running and caches its
result, so the retry is served from that cache instead of starting the
same scan again. Identical concurrent requests share one computation.
object
Human-readable description of what went wrong.
true when the query is still running rather than
failing. Retry after Retry-After seconds.
Examples
{ "error": "analytics unavailable"}{ "error": "still computing — try again in a few seconds", "pending": true}Headers
Section titled “Headers ”Example
5Seconds to wait before retrying. Sent only with pending.