Skip to content
nsin docs

Account-wide summary

GET
/analytics/global-summary
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.

period
string
default: 24h
Allowed values: 1h 3h 6h 12h 24h 48h 7d 30d all

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.

Account-wide totals.

Media type application/json
object
total_requests
integer
total_bandwidth

Bytes.

integer
unique_visitors
integer
error_rate

Share of requests that failed, 0–1.

number
cache_hit_rate

Share of cacheable requests served from cache, 0–1.

number
domains

How many domains contributed.

integer
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.)

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"
}

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"
}

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.

Media type application/json
object
error
required

Human-readable description of what went wrong.

string
pending

true when the query is still running rather than failing. Retry after Retry-After seconds.

boolean
Examples
{
"error": "analytics unavailable"
}
Retry-After
integer
Example
5

Seconds to wait before retrying. Sent only with pending.