Skip to content
nsin docs

Origin-direction bandwidth across your domains

GET
/analytics/bandwidth-overview
curl --request GET \
--url 'https://api.nsin.ir/analytics/bandwidth-overview?period=1h' \
--header 'Authorization: Bearer <token>'

Bytes sent to and received from origins, as a time series plus per-domain totals.

ratio is min(up,down) / max(up,down). A value near 1.0 means the domain pushes about as much to the origin as it pulls back, which is unusual for web traffic (downloads normally dominate) and sets flagged.

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

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.

Bandwidth series and per-domain totals.

Media type application/json
object
series
Array<object>
object
timestamp
string format: date-time
up

Bytes sent to the origin.

integer
down

Bytes received from the origin.

integer
domains
Array<object>
object
domain
string
up
integer
down
integer
ratio

min(up,down) / max(up,down).

number
flagged

Set when ratio is close to 1.0, which is unusual for web traffic.

boolean
Example generated
{
"series": [
{
"timestamp": "2026-04-15T12:00:00Z",
"up": 1,
"down": 1
}
],
"domains": [
{
"domain": "example",
"up": 1,
"down": 1,
"ratio": 1,
"flagged": true
}
]
}

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.