Requests per gateway
const url = 'https://api.nsin.ir/analytics/gateways?domain=example.com&period=3h';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nsin.ir/analytics/gateways?domain=example.com&period=3h' \ --header 'Authorization: Bearer <token>'Request counts for each gateway currently switched on for the domain, with a zero-filled series over the period — one point per bucket whether or not traffic landed in it.
Which hostnames count as gateways is resolved server-side from the domain’s records, so a gateway switched off drops out of this response along with its history.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The domain name (for example example.com). These endpoints take the
domain as a query parameter rather than a path segment.
Example
example.comTime window, ending now. Buckets are hourly up to 24h and daily for
7d and 30d. An unrecognised value falls back to 24h.
Responses
Section titled “ Responses ”One entry per enabled gateway. Empty when none are on.
object
The gateway this traffic belongs to.
Hostname the requests were made to, e.g. chatgpt-84213.example.com.
Total requests over the period.
One point per bucket, oldest first. The last point is the current, partial bucket.
object
Bucket start (UTC).
Requests in the bucket.
Example generated
[ { "gateway_id": 1, "hostname": "example", "requests": 1, "series": [ { "t": "2026-04-15T12:00:00Z", "c": 1 } ] }]Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}