Origin-direction bandwidth across your domains
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
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.
Query parameters
- periodstringquery
Time window, ending now. Time series are bucketed by minute for
1h, by hour up to48h, and by day for7dand30d. Buckets are cut on Asia/Tehran (UTC+03:30) boundaries and emitted as UTC instants, so an hourly bucket starts at:30UTC. An unrecognised value falls back to24h.One of:"1h""3h""6h""12h""24h""48h""7d""30d"Default:"24h"
Responses
200Bandwidth series and per-domain totals.
Content type: application/json
- seriesarray of OriginBandwidthPoint
Item fields
- timestampstring (date-time)
- upinteger
Bytes sent to the origin.
- downinteger
Bytes received from the origin.
- domainsarray of DomainBandwidth
Item fields
- domainstring
- upinteger
- downinteger
- rationumber
min(up,down) / max(up,down). - flaggedboolean
Set when
ratiois close to 1.0, which is unusual for web traffic.
{
"series": [
{
"timestamp": "2026-01-01T00:00:00Z",
"up": 0,
"down": 0
}
],
"domains": [
{
"domain": "string",
"up": 0,
"down": 0,
"ratio": 0,
"flagged": true
}
]
}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.
{
"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.
{
"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
truewhen the query is still running rather than failing. Retry afterRetry-Afterseconds.
{
"error": "analytics unavailable"
}Example request
curl -X GET "https://api.nsin.ir/analytics/bandwidth-overview" \
-H "Authorization: Bearer $NSIN_API_KEY"