---
title: "ASN resources by country"
method: GET
path: "/api/v1/network/asn"
tags: ["Sugra NetAtlas"]
---

# ASN resources by country

`GET /api/v1/network/asn`

When ?country={cc} is provided, returns the ASN + IPv4 + IPv6 resource counts allocated to that country. Replaces the legacy /bgp/country/{cc}/resources path per spec section 12.

## Query parameters

- `country` string, required — ISO 3166-1 alpha-2 country code.
- `limit` integer — Max items per resource list (asn/ipv4/ipv6) in this page.
- `offset` integer — 0-based offset into each resource list.

## Response `200`

Successful Response

- NetworkAsnData
  - `country` string, nullable
  - `asn_count` union
    - integer
    - number
  - `ipv4_count` union
    - integer
    - number
  - `ipv6_count` union
    - integer
    - number
  - `asns` string[], nullable
  - `ipv4_prefixes` string[], nullable
  - `ipv6_prefixes` string[], nullable
  - `pagination` Pagination
    - `limit` union
      - integer
      - number
    - `offset` union
      - integer
      - number
    - `asn` Ipv4
      - `total` union
        - integer
        - number
      - `count` union
        - integer
        - number
      - `truncated` boolean, nullable
      - `next_offset` union
        - integer
        - number
    - `ipv4` Ipv4
      - `total` union
        - integer
        - number
      - `count` union
        - integer
        - number
      - `truncated` boolean, nullable
      - `next_offset` union
        - integer
        - number
    - `ipv6` Ipv4
      - `total` union
        - integer
        - number
      - `count` union
        - integer
        - number
      - `truncated` boolean, nullable
      - `next_offset` union
        - integer
        - number
  - `_meta` AtlasMeta
    - `product` string, required — Always 'Sugra NetAtlas'.
    - `atlas_built_at` string, nullable — UTC ISO-8601 build time of the atlas snapshot that answered; null only when no connector can vouch for one.
    - `privacy_signal_version` string, required — Version of the privacy/default-route signal set.
    - `confidence` string, required — Confidence of the privacy/default-route signal: high, medium or low.
    - `accuracy` string, required — Accuracy class of the answer (e.g. public, city, country, unknown).
    - `sources` string[], required — Sugra-branded upstream families that contributed.
    - `data_time` string, nullable — When the DATA is from (UTC ISO-8601); null when nothing can vouch for it.
    - `response_time` string, required — When Sugra answered (UTC ISO-8601).
    - `partial` boolean, required — True when at least one upstream failed and the answer is incomplete.
    - `geo_confidence` string, nullable — IP-geo responses only: how trustworthy the resolved city/country is (downgrades for anycast/CDN).
    - `served_from` string, nullable — Where the answer came from (local atlas, live proxy, cache).
    - `fallback_reason` string, nullable — Why a fallback path served the answer, when one did.
    - `sources_coverage` unknown
    - `cached` boolean, nullable — True when the answer was served from the response cache (routes that cache whole answers).
    - `atlas_sha256` string, nullable — SHA-256 of the atlas snapshot (sources/coverage).
    - `endpoint_version` string, nullable — Endpoint contract version where a route declares one (sources/coverage: v1).

## Other responses

- `401` — Missing or invalid `x-api-key` header. JSON body with a stable `code` distinguishing `missing_api_key` (no header sent) from `invalid_api_key` (header sent, key not accepted); any other 401 source carries the generic `unauthorized` with its detail as `reason`. Plus `hint`. `plan` is always null on 401 - an unauthenticated request has no plan; quota exhaustion is 429, not 401.
- `422` — Validation Error
- `429` — Daily rate limit exceeded. Check `X-RateLimit-Reset` for the next window.
- `503` — Upstream source is temporarily unavailable. Retry after a short delay.

## Changes

- **2026-08-28** `560e8847c7b3` — 3 breaking
  - response property `asns/anyOf[subschema #1]/items/` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `ipv4_prefixes/anyOf[subschema #1]/items/` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `ipv6_prefixes/anyOf[subschema #1]/items/` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
- **2026-08-22** `914af3d38c7c` — 1 breaking, 9 info
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - added the optional property `_meta` to the response with the `200` status
  - added the optional property `asn_count` to the response with the `200` status
  - added the optional property `asns` to the response with the `200` status
  - …6 more
- **2026-08-12** `062b7040e9bc` — 2 breaking, 1 info
  - the `query` request parameter `country` became required
  - `query` request parameter `country` list-of-types was narrowed by removing types `null`
  - for the `query` request parameter `country`, the type/format was generalized from ``/`` to `string`/``
- …earlier changes not shown

[Full history](https://skmtc.dev/sugra/apis/sugra-api/changes/api/v1/network/asn/get.md)

---

[API](https://skmtc.dev/sugra/apis/sugra-api.md) · [All operations](https://skmtc.dev/sugra/apis/sugra-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sugra/sugra-api/revisions/87582f2e0110/schema)
