Get the domain's traffic usage
const url = 'https://api.nsin.ir/domains/example.com/traffic-usage';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/domains/example.com/traffic-usage \ --header 'Authorization: Bearer <token>'Daily traffic rows for this domain, with totals and current prices. Same three-tier model as the account-wide endpoint. Readable by shared members.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comResponses
Section titled “ Responses ”Usage rows, totals and prices.
object
One day’s traffic for one domain.
object
Legacy two-tier column, present on historical rows. Folded into the direct total for display.
The portion above the plan’s free allowance.
The portion above the plan’s free allowance.
The portion above the plan’s free allowance.
Rials per GB of cache-served traffic.
Rials per GB of proxied traffic.
Rials per GB of direct traffic.
Example generated
{ "usage": [ { "id": 1, "domain_id": 1, "user_id": 1, "date": "2026-04-15", "billing_window_key": "example", "cached_bytes": 1, "proxied_bytes": 1, "direct_bytes": 1, "bypass_bytes": 1, "charged_rials": 1, "window_start": "2026-04-15T12:00:00Z", "window_end": "2026-04-15T12:00:00Z", "billed_cached_bytes": 1, "billed_proxied_bytes": 1, "billed_direct_bytes": 1, "charged_cached_rials": 1, "charged_proxied_rials": 1, "charged_direct_rials": 1, "invoice_id": 1, "processed_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z" } ], "total_cached_bytes": 1, "total_proxied_bytes": 1, "total_direct_bytes": 1, "total_charged_rials": 1, "cached_price_per_gb": 1, "proxied_price_per_gb": 1, "direct_price_per_gb": 1}Missing domain.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}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"}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"}