ASN Prefixes
developer/v1/network/asn/prefixesReturns all IPv4 and IPv6 prefixes announced by a given Autonomous System Number (ASN) via BGP. Includes prefix CIDR, name, description, country code, calculated IP count per prefix, and total IP space. Data sourced from the RIPEstat Data API's live BGP routing tables per RFC 4271 (BGP-4).
What It Does
Queries the RIPEstat Data API to retrieve all IP prefixes currently announced by the specified ASN in the global BGP routing table. Returns IPv4 prefixes with CIDR notation, IP count (calculated as 2^(32-prefix_length)), name, description, and country code. IPv6 prefixes include CIDR, name, description, and country code. Also provides aggregate totals of prefixes and estimated total IPv4 addresses. Results are cached for 1 hour since BGP prefix changes are infrequent.
Why It's Useful
Understanding the full IP footprint of an autonomous system is critical for security operations, threat intelligence, and network planning. It enables comprehensive blocklisting/allowlisting at the ASN level, attack surface enumeration, vendor IP space auditing, and peering capacity assessment. This is the foundation of ASN-based security intelligence — knowing every IP range an organization controls. See RFC 6811 (BGP Prefix Origin Validation) and RFC 7908 (Route Leak Classification) for related security standards.
Use Cases
Threat Infrastructure Mapping
Given a malicious IP, look up its ASN and then enumerate all prefixes to identify the full scope of potentially hostile infrastructure. Cross-reference with other threat feeds to build comprehensive blocklists at the AS level.
Complete ASN-level blocklisting based on threat intelligence, covering all IP ranges an adversary controls.
Dynamic Firewall Allowlisting
Build firewall allowlists based on a vendor's ASN prefixes (e.g., AS16509 for AWS, AS13335 for Cloudflare) rather than maintaining static IP lists that go stale.
Self-updating, maintainable allowlists that automatically adapt to BGP prefix changes without manual intervention.
Attack Surface Assessment
Enumerate all externally-routed IP prefixes for an organization's ASN to map the complete attack surface. Identify forgotten subnets, shadow IT, and infrastructure outside the scope of existing security controls.
Comprehensive external attack surface discovery backed by authoritative BGP routing data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
asn | string | Required | The Autonomous System Number (with or without "AS" prefix, e.g., "13335" or "AS13335")Example: 13335 |
Response Fields
| Field | Type | Description |
|---|---|---|
asn | number | The queried ASN |
prefixes_v4 | array | IPv4 prefixes: prefix (CIDR), ip_count, name, description |
prefixes_v4[].prefix | string | IPv4 prefix in CIDR notation (e.g., 104.16.0.0/13) |
prefixes_v4[].ip_count | number | Number of IP addresses in this prefix (2^(32-prefix_length)) |
prefixes_v4[].name | string | Prefix name from routing registry |
prefixes_v4[].description | string | Prefix description from AS holder info |
prefixes_v6 | array | IPv6 prefixes: prefix (CIDR), name, description |
total_prefixes_v4 | number | Total number of IPv4 prefixes announced |
total_prefixes_v6 | number | Total number of IPv6 prefixes announced |
total_ips | number | Estimated total IPv4 addresses across all prefixes |
Code Examples
curl "https://api.edgedns.dev/v1/network/asn/prefixes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "asn=13335"const response = await fetch(
'https://api.edgedns.dev/v1/network/asn/prefixes?asn=13335',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/network/asn/prefixes',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'asn': '13335'
}
)
data = response.json()
print(data)Read the full ASN Prefixes guide
Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.
Try This Endpoint
Test the ASN Prefixes endpoint live in the playground.