Skip to content

Requests per gateway

GET
/analytics/gateways
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.

domain
required
string

The domain name (for example example.com). These endpoints take the domain as a query parameter rather than a path segment.

Example
example.com
period
string
default: 24h
Allowed values: 3h 6h 12h 24h 7d 30d

Time window, ending now. Buckets are hourly up to 24h and daily for 7d and 30d. An unrecognised value falls back to 24h.

One entry per enabled gateway. Empty when none are on.

Media type application/json
Array<object>
object
gateway_id

The gateway this traffic belongs to.

integer
hostname

Hostname the requests were made to, e.g. chatgpt-84213.example.com.

string
requests

Total requests over the period.

integer
series

One point per bucket, oldest first. The last point is the current, partial bucket.

Array<object>
object
t

Bucket start (UTC).

string format: date-time
c

Requests in the bucket.

integer
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.

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 is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only 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"
}