Traceroute API — /api/v1/ip/traceroute
Streams each hop as it's discovered. Returns hop IP, hostname (if reverse-resolvable), RTT, and ASN.
01 · OVERVIEW
What Traceroute does
Streams each hop as it's discovered. Returns hop IP, hostname (if reverse-resolvable), RTT, and ASN.
- Method GET
- Path /api/v1/ip/traceroute
- Stability STABLE
- Version v2026-05-15
- Summary Discover the network path to a host (hop-by-hop).
02 · PARAMETERS
Request parameters
Pass these as query-string parameters (or, where indicated, in the request headers). Required params marked required.
- host (required) — string Hostname or IP.
- maxHop — integer, default 10 Max hops to probe (1–20).
- timeout — integer, default 3000 Per-hop timeout in ms (max 10000).
- p6 — boolean, default false Use IPv6 (default IPv4).
03 · RESPONSE
Response schema
All successful responses follow the standard `{ success: true, data: {...} }` envelope. Notable fields on the data object for this endpoint:
- event: hop — SSE Per-hop result. `data: {hop, ip, hostname, rttMs, asn, country}`.
- event: done — SSE Sent on completion. `data: {hops, target, reached}`.
04 · EXAMPLE
Example response
Truncated but representative example for a real lookup:
{
"stream": [
"event: hop\ndata: {\"hop\": 1, \"ip\": \"10.0.0.1\", \"rttMs\": 1, \"asn\": null}\n\n",
"event: hop\ndata: {\"hop\": 2, \"ip\": \"172.253.71.106\", \"hostname\": \"google.com\", \"rttMs\": 12, \"asn\": 15169, \"country\": \"US\"}\n\n",
"event: done\ndata: {\"hops\": 2, \"target\": \"google.com\", \"reached\": true}\n\n"
]
}05 · ERRORS
Error codes
Errors return HTTP status codes paired with stable machine-readable codes. Match on the code field rather than the human-readable message.
- 504 MAX_HOPS_EXCEEDED Hit `maxHop` without reaching the target — bump `maxHop` and retry.
06 · BEST PRACTICES
Implementation tips
Patterns we recommend when integrating this endpoint:
- Lower `maxHop` to 15 for most paths — fewer than 20 hops needed for >99% of public targets.
07 · FAQ
Frequently asked questions
- Some hops show `*`? That hop's router didn't respond within `timeout`. Common — many backbone routers de-prioritise ICMP.