nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Analytics

Account-wide peak requests per second

gethttps://api.nsin.ir/analytics/global-summary/peak

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

The highest number of requests served in any single second of the period, across the same domains /analytics/global-summary covers.

This is a full scan of the request log rather than a lookup, so it is served on demand and may take a while for long periods. Results are cached per account; all is refreshed at most once a day.

Query parameters

  • periodstringquery

    Time window, ending now. Same values as /analytics/global-summary, including all for the whole retained history. An unrecognised value falls back to 24h.

    One of: "1h" "3h" "6h" "12h" "24h" "48h" "7d" "30d" "all"
    Default: "24h"

Responses

200Peak requests per second.

Content type: application/json

  • peak_rpsinteger

    Highest request count in any single second of the period.

json
{
  "peak_rps": 0
}
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.

json
{
  "error": "invalid 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.

json
{
  "error": "rate limit exceeded"
}
503Either 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.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

  • pendingboolean

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

json
{
  "error": "analytics unavailable"
}

Example request

bash
curl -X GET "https://api.nsin.ir/analytics/global-summary/peak" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc