API Documentation

Free RESTful API for BGP routing data, ASN information, and GeoIP lookups.

Overview

All API endpoints return JSON. No authentication is required. Base URL:

https://bgpv6.com/api/v1
GET All endpoints use GET method
No API key required
JSON response format
GET /api/v1/lookup/{ip}

Look up BGP routing information for an IP address. Returns origin ASN, prefix, AS path, and optional GeoIP data.

Parameters
NameTypeDescription
ipstringIPv4 or IPv6 address (e.g., 8.8.8.8 or 2001:4860:4860::8888)
Example
curl https://bgpv6.com/api/v1/lookup/8.8.8.8
Response
{
  "data": {
    "prefix": "8.8.8.0/24",
    "origin_asn": 15169,
    "as_path": [13335, 15169],
    "is_ipv6": false
  },
  "geoip": {
    "country": "US",
    "city": "Mountain View",
    "latitude": 37.386,
    "longitude": -122.0838
  }
}
GET /api/v1/asn/{asn}

Get detailed information for an Autonomous System Number including name, description, RIR, country, prefix counts, and peer relationships.

Parameters
NameTypeDescription
asnintegerAS number (e.g., 13335 or AS13335)
Example
curl https://bgpv6.com/api/v1/asn/13335
Response
{
  "asn": 13335,
  "name": "CLOUDFLARENET",
  "description": "Cloudflare, Inc.",
  "country": "US",
  "rir": "ARIN",
  "prefix_v4": 1524,
  "prefix_v6": 142,
  "peers": {
    "upstream": [...],
    "downstream": [...]
  }
}
GET /api/v1/asn/{asn}/prefixes

List all prefixes originated by an ASN with pagination support.

Parameters
NameTypeDescription
asnintegerAS number
filterstringFilter by IP version: all, v4, or v6 (default: all)
pageintegerPage number (default: 1)
per_pageintegerResults per page (default: 25, max: 100)
Example
curl "https://bgpv6.com/api/v1/asn/13335/prefixes?filter=v6&page=1"
GET /api/v1/search?q={query}

Search for ASNs by number, name, or description. Returns up to 50 matching results.

Parameters
NameTypeDescription
qstringSearch query (e.g., cloudflare, 13335, hurricane)
Example
curl "https://bgpv6.com/api/v1/search?q=cloudflare"
GET /api/v1/geoip/{ip}

Get geographic location data for an IP address using MaxMind GeoIP databases.

Parameters
NameTypeDescription
ipstringIPv4 or IPv6 address
Example
curl https://bgpv6.com/api/v1/geoip/8.8.8.8
Response
{
  "ip": "8.8.8.8",
  "country": "US",
  "country_name": "United States",
  "city": "Mountain View",
  "latitude": 37.386,
  "longitude": -122.0838,
  "asn": 15169,
  "org": "Google LLC"
}