Skip to content
Start here

Get tier-1 path segments for an AS

client.radar.bgp.routes.paths.list(numberasn, PathListParams { collector, format, ipVersion } query?, RequestOptionsoptions?): PathListResponse { asnInfo, collectors, meta, paths }
GET/radar/bgp/routes/paths/{asn}

Retrieves the paths an AS uses to reach the tier-1 clique, derived from RouteViews RIB snapshots. Each entry is an ordered AS-path segment (from the queried AS toward a tier-1) with the number of observed paths and peers, and the collectors that observed it. By default segments are merged across all active collectors; pass “collector” to scope to one. The response also includes an “asnInfo” map (keyed by ASN) with the name and country for every ASN in the returned segments plus the queried ASN (best-effort; null when unavailable).

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
asn: number

Single Autonomous System Number (ASN) as integer.

query: PathListParams { collector, format, ipVersion }
collector?: string

Scope to a single RouteViews collector (e.g. “route-views3”). Omit to merge across all active collectors (identical path segments are deduplicated, observation counts summed, and every contributing collector listed).

maxLength100
format?: "JSON" | "CSV"

Format in which results will be returned.

One of the following:
"JSON"
"CSV"
ipVersion?: "IPv4" | "IPv6"

Address family of the observed paths. Defaults to IPv4.

One of the following:
"IPv4"
"IPv6"
ReturnsExpand Collapse
PathListResponse { asnInfo, collectors, meta, paths }
asnInfo: Record<string, ASNInfo> | null
asn: number

ASN number.

country: string | null

Alpha-2 country code.

name: string | null

AS name.

collectors: Array<string>
meta: Meta { dataTime, effectiveCollector, queryTime, stale }
dataTime: string | null

Timestamp of the underlying RIB data.

formatdate-time
effectiveCollector: string | null
queryTime: string | null

Timestamp when the query was executed.

formatdate-time
stale: boolean
paths: Array<Path>
collectors: Array<string>
pathsCount: number
peersCount: number
segment: Array<number>

Get tier-1 path segments for an AS

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const paths = await client.radar.bgp.routes.paths.list(174);

console.log(paths.asnInfo);
{
  "result": {
    "asnInfo": {
      "13335": {
        "asn": 13335,
        "country": "US",
        "name": "Cloudflare"
      }
    },
    "collectors": [
      "string"
    ],
    "meta": {
      "dataTime": "2019-12-27T18:11:19.117Z",
      "effectiveCollector": "effectiveCollector",
      "queryTime": "2019-12-27T18:11:19.117Z",
      "stale": true
    },
    "paths": [
      {
        "collectors": [
          "string"
        ],
        "pathsCount": 0,
        "peersCount": 0,
        "segment": [
          0
        ]
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "result": {
    "asnInfo": {
      "13335": {
        "asn": 13335,
        "country": "US",
        "name": "Cloudflare"
      }
    },
    "collectors": [
      "string"
    ],
    "meta": {
      "dataTime": "2019-12-27T18:11:19.117Z",
      "effectiveCollector": "effectiveCollector",
      "queryTime": "2019-12-27T18:11:19.117Z",
      "stale": true
    },
    "paths": [
      {
        "collectors": [
          "string"
        ],
        "pathsCount": 0,
        "peersCount": 0,
        "segment": [
          0
        ]
      }
    ]
  },
  "success": true
}