Traceroute
POST/accounts/{account_id}/diagnostics/traceroute
Run traceroutes from Cloudflare colos.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Body ParametersJSON
Traceroute
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/diagnostics/traceroute \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"targets": [
"203.0.113.1",
"cloudflare.com"
],
"colos": [
"den",
"sin"
],
"options": {
"max_ttl": 15,
"packet_type": "icmp"
}
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": [
{
"colos": [
{
"colo": {
"city": "Denver, CO, US",
"name": "den01"
},
"error": "",
"hops": [
{
"nodes": [
{
"asn": "AS13335",
"ip": "1.1.1.1",
"labels": [
"string"
],
"max_rtt_ms": 0,
"mean_rtt_ms": 0,
"min_rtt_ms": 0,
"name": "one.one.one.one",
"packet_count": 3,
"std_dev_rtt_ms": 0
}
],
"packets_lost": 0,
"packets_sent": 0,
"packets_ttl": 0
}
],
"target_summary": {
"asn": "",
"ip": "1.1.1.1",
"max_latency_ms": 0.034,
"mean_latency_ms": 0.021,
"min_latency_ms": 0.014,
"name": "1.1.1.1",
"packet_count": 3,
"std_dev_latency_ms": 0.011269427669584647
},
"traceroute_time_ms": 0
}
],
"target": "1.1.1.1"
}
]
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": [
{
"colos": [
{
"colo": {
"city": "Denver, CO, US",
"name": "den01"
},
"error": "",
"hops": [
{
"nodes": [
{
"asn": "AS13335",
"ip": "1.1.1.1",
"labels": [
"string"
],
"max_rtt_ms": 0,
"mean_rtt_ms": 0,
"min_rtt_ms": 0,
"name": "one.one.one.one",
"packet_count": 3,
"std_dev_rtt_ms": 0
}
],
"packets_lost": 0,
"packets_sent": 0,
"packets_ttl": 0
}
],
"target_summary": {
"asn": "",
"ip": "1.1.1.1",
"max_latency_ms": 0.034,
"mean_latency_ms": 0.021,
"min_latency_ms": 0.014,
"name": "1.1.1.1",
"packet_count": 3,
"std_dev_latency_ms": 0.011269427669584647
},
"traceroute_time_ms": 0
}
],
"target": "1.1.1.1"
}
]
}