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

Traffic by edge node, across your domains

gethttps://api.nsin.ir/analytics/nodes-overview

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

Per-node totals, error and cache rates, latency, a requests-over-time series, and the busiest domains on each node — aggregated over every domain you can see, or one domain with domain_id.

This is the account-wide counterpart of /analytics/traffic-by-node, which covers a single domain and splits by cache status instead.

Two kinds of row need care when reading the list:

  • node: "" — requests the serving edge did not stamp with a node name. They are counted so the per-node rows still add up to totals, but they cannot be attributed to a point of presence.
  • requests: 0 with registered: true — a node that is in service but served nothing in the period. Kept in the list so a node that stopped reporting is visible rather than silently absent.

error_rate and cache_hit_rate are percentages (0–100). Durations are in milliseconds and exclude WebSocket requests, whose lifetime is the whole upgraded connection.

Query parameters

  • periodstringquery

    Time window, ending now. Time series are bucketed by minute for 1h, by hour up to 48h, and by day for 7d and 30d. Buckets are cut on Asia/Tehran (UTC+03:30) boundaries and emitted as UTC instants, so an hourly bucket starts at :30 UTC. An unrecognised value falls back to 24h.

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

    Numeric domain id — note this endpoint scopes by id, not by the domain name the rest of the API uses. Omit to cover every active domain you can see.

Responses

200Per-node totals with the scope-wide total they add up to.

Content type: application/json

  • dataarray of NodeOverviewItem
    Item fields
    • nodestring

      Node identifier. Empty when the serving edge reported no node name.

    • node_labelstring

      Human-readable name. Absent for a node that is not registered.

    • countrystring

      ISO country code.

    • registeredboolean

      Whether the name matches a registered edge node.

    • activeboolean

      Whether the registered node is in service.

    • requestsinteger
    • bandwidthinteger

      Egress bytes.

    • bytes_ininteger

      Bytes received from clients.

    • unique_visitorsinteger
    • error_ratenumber

      Percentage of requests that returned 4xx or 5xx, 0–100.

    • errors_5xxinteger
    • cache_hit_ratenumber

      Percentage of cache lookups served from cache, 0–100.

    • cached_requestsinteger
    • avg_durationnumber

      Mean response time in milliseconds, WebSocket requests excluded.

    • p95_durationnumber

      95th percentile response time in milliseconds, WebSocket requests excluded.

    • latest_eventstring (date-time)

      Most recent request this node served in scope. Null when it served none.

    • seriesarray of NodeSeriesPoint

      Traffic over time, one bucket per period step.

      Item fields
      • timestampstring (date-time)
      • countinteger
      • bytesinteger

        Egress bytes in the bucket.

    • top_domainsarray of NodeDomainStats

      The busiest domains on this node, at most five.

      Item fields
      • domain_idinteger
      • domain_namestring

        Empty when the traffic matched no registered domain.

      • requestsinteger
      • bandwidthinteger

        Egress bytes.

  • totalsobject

    What the per-node rows add up to over the same scope.

    Fields
    • requestsinteger
    • bandwidthinteger

      Egress bytes.

    • nodes_with_trafficinteger
    • unattributed_requestsinteger

      Requests whose row carried no node name.

json
{
  "data": [
    {
      "node": "string",
      "node_label": "string",
      "country": "string",
      "registered": true,
      "active": true,
      "requests": 0,
      "bandwidth": 0,
      "bytes_in": 0,
      "unique_visitors": 0,
      "error_rate": 0,
      "errors_5xx": 0,
      "cache_hit_rate": 0,
      "cached_requests": 0,
      "avg_duration": 0,
      "p95_duration": 0,
      "latest_event": "2026-01-01T00:00:00Z",
      "series": [
        {
          "timestamp": "2026-01-01T00:00:00Z",
          "count": 0,
          "bytes": 0
        }
      ],
      "top_domains": [
        {
          "domain_id": 0,
          "domain_name": "string",
          "requests": 0,
          "bandwidth": 0
        }
      ]
    }
  ],
  "totals": {
    "requests": 0,
    "bandwidth": 0,
    "nodes_with_traffic": 0,
    "unattributed_requests": 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"
}
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.

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

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/nodes-overview" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc