Get tier-1 path segments for an AS
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.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Accepted Permissions (at least one required)
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
}