The BGPScout API allows you to query network data, retrieve ASN details, and submit traceroute results. All responses are JSON unless otherwise noted.
Base URL:https://bgpscout.io/api
Every traceroute submitted to BGPScout goes through a multi-stage enrichment pipeline before being included in any analysis or public results:
A "boomerang route" is detected when a traceroute from country A to a destination also in country A transits through a different country. This indicates suboptimal routing where domestic traffic unnecessarily crosses international borders.
Some endpoints require an API key passed via the X-API-Key HTTP header. Public endpoints do not require authentication.
To obtain an API key, log in and visit your Account Settings page.
curl -H "X-API-Key: your_api_key_here" \
https://bgpscout.io/api/traceroutes/submit
All endpoints are rate-limited to 100 requests per hour per API key (or per IP for unauthenticated requests). Exceeding this limit returns a 429 response.
| Header | Description |
|---|---|
RateLimit-Limit | Maximum requests per window |
RateLimit-Remaining | Requests remaining in current window |
RateLimit-Reset | Seconds until limit resets |
Returns aggregate statistics about all collected traceroutes.
curl https://bgpscout.io/api/traceroutes/stats{
"success": true,
"stats": {
"total_traces": 14523,
"source_countries": 12,
"unique_destinations": 987,
"unique_source_asns": 45,
"boomerang_count": 312,
"leaves_country_count": 1804,
"earliest_trace": "2025-01-15T00:00:00.000Z",
"latest_trace": "2026-04-02T18:30:00.000Z"
},
"top_source_countries": [
{ "source_country": "CA", "trace_count": 9821 },
{ "source_country": "US", "trace_count": 3104 }
]
}
Submit one or more traceroute results for storage and analysis.
| Name | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your API key |
| Content-Type | Yes | application/json |
{
"traces": [
{
"host": "example.com",
"dest_ip": "93.184.216.34",
"source_ip": "192.168.1.1",
"source_country": "CA",
"platform": "linux",
"tool": "mtr",
"completed": true,
"hops": [
{
"hop_number": 1,
"ip": "192.168.1.1",
"hostname": "gateway.local",
"rtt_avg": 1.2,
"rtt_min": 0.8,
"rtt_max": 2.1,
"loss_pct": 0
},
{
"hop_number": 2,
"ip": "10.0.0.1",
"rtt_avg": 5.4
}
]
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
| hop_number | integer | Yes | TTL hop position (1-64) |
| ip | string | No | IP address of the hop (null for timeouts) |
| hostname | string | No | Reverse DNS hostname |
| rtt_avg | float | No | Average round-trip time in ms |
| rtt_min | float | No | Minimum RTT in ms |
| rtt_max | float | No | Maximum RTT in ms |
| loss_pct | float | No | Packet loss percentage (0-100) |
{
"success": true,
"trace_ids": [1042, 1043],
"count": 2
}{
"success": false,
"error": "Validation failed",
"details": [
{ "trace_index": 0, "errors": ["Invalid dest_ip format"] }
]
}
Returns detailed information about an ASN including peering quality and route scoring.
| Name | Type | Description |
|---|---|---|
| :asn | integer | The AS number to look up (e.g. 577) |
curl https://bgpscout.io/api/asn/577{
"asn": 577,
"name": "BACOM",
"country": "CA",
"rir": "arin",
"traffic_level": "Medium",
"network_type": "NSP",
"on_ix": true,
"peering_quality": {
"crossing_rate": 0.12,
"quality_tag": "Good"
},
"route_score": {
"quality": 78.5,
"route": 82.1,
"overall": 80.3
},
"url": "https://bgpscout.io/asns/577"
}
Returns a self-contained HTML card for an ASN that can be embedded via an iframe.
<iframe src="https://bgpscout.io/api/embed/asn/577"
width="320" height="200"
frameborder="0"></iframe>The widget displays the ASN name, country, peering quality badge, route score, and a link back to BGPScout.
The BGPScout MTR client collects traceroute data and submits it to the API automatically.
# Linux / macOS
chmod +x bgpscout-mtr
sudo mv bgpscout-mtr /usr/local/bin/
# Verify installation
bgpscout-mtr --version# Set your API key (from /account)
bgpscout-mtr config --api-key YOUR_API_KEY
# Optionally set your source ASN
bgpscout-mtr config --source-asn 33185# Run a single trace
bgpscout-mtr trace example.com
# Run against Tranco top sites (batch mode)
bgpscout-mtr batch --targets tranco-top100.txt
# Run with automatic submission
bgpscout-mtr trace --submit example.com
# Schedule recurring traces (cron-friendly)
bgpscout-mtr batch --targets targets.txt --submit --quiet$ bgpscout-mtr trace --submit google.ca
Tracing google.ca (142.250.80.67)...
1 gateway.local (192.168.1.1) 1.2ms
2 10.0.0.1 5.4ms
3 isp-core.example.net 12.1ms
...
Submitted trace ID: 1042