---
updatedAt: 2026-03-01T18:48:49.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/edge-diagnostics/llms.txt
---

# Run the URL health check

```curl cURL
egcurl --eg-section default --request POST \
  --url "https://$hostname/edge-diagnostics/v1/url-health-check" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '
{
    "url": "http://www.example.com",
    "spoofEdgeIp": "192.0.2.0",
    "edgeLocationId": "allen-tx-unitedregionCodes",
    "ipVersion": "IPV4",
    "port": 80,
    "packetType": "TCP",
    "queryType": "A",
    "requestHeaders": [
        "Accept-Language: en-US"
    ],
    "viewsAllowed": [
        "CONNECTIVITY",
        "LOGS"
    ]
}'
```

```node Node
const EdgeGrid = require("akamai-edgegrid");
const os = require("os");
const edgercPath = os.homedir + "/.edgerc.txt";
const edgercSection = "default";  
const eg = new EdgeGrid({
  path: edgercPath,
  section: edgercSection
});   


eg.auth({
  path: `/edge-diagnostics/v1/url-health-check`,
  method: "POST",
  headers: {
    "Content-Type": "application/json",

    "Accept": "application/json"},
  body: {
    "url": "http://www.example.com",
    "spoofEdgeIp": "192.0.2.0",
    "edgeLocationId": "allen-tx-unitedregionCodes",
    "ipVersion": "IPV4",
    "port": 80,
    "packetType": "TCP",
    "queryType": "A",
    "requestHeaders": [
        "Accept-Language: en-US"
    ],
    "viewsAllowed": [
        "CONNECTIVITY",
        "LOGS"
    ]
}                    
});
eg.send(function(error, response, body) {
  console.log(body);    
});
```

```python Python
import requests
from akamai.edgegrid import EdgeGridAuth, EdgeRc
from urllib.parse import urljoin

edgerc = EdgeRc('~/.edgerc.txt')
section = 'default'
baseurl = 'https://%s' % edgerc.get(section, 'host')

session = requests.Session()
session.auth = EdgeGridAuth.from_edgerc(edgerc, section)
 

path= '/edge-diagnostics/v1/url-health-check'
headers = {
  "Content-Type": "application/json",

  "Accept": "application/json"}
payload = {
    "url": "http://www.example.com",
    "spoofEdgeIp": "192.0.2.0",
    "edgeLocationId": "allen-tx-unitedregionCodes",
    "ipVersion": "IPV4",
    "port": 80,
    "packetType": "TCP",
    "queryType": "A",
    "requestHeaders": [
        "Accept-Language: en-US"
    ],
    "viewsAllowed": [
        "CONNECTIVITY",
        "LOGS"
    ]
}  

result = session.post(urljoin(baseurl, path), headers=headers, json=payload)
print(result.status_code)
print(result.json())
```

```json Response Example
{
  "requestId": 251,
  "executionStatus": "SUCCESS",
  "createdBy": "jsmith",
  "createdTime": "2021-09-29T05:07:30+0000",
  "internalIp": "192.0.2.1",
  "spoofEdgeIpLocation": {
    "city": "MUMBAI",
    "regionCode": "MH",
    "countryCode": "IN",
    "asNumber": 20940
  },
  "internalIpLocation": {
    "city": "ASHBURN",
    "regionCode": "VA",
    "countryCode": "US",
    "asNumber": 20940
  },
  "request": {
    "url": "http://www.example.com",
    "edgeLocationId": "wellington-newzealand",
    "spoofEdgeIp": "192.0.2.2",
    "ipVersion": "IPV6",
    "port": 80,
    "packetType": "TCP",
    "queryType": "A",
    "viewsAllowed": [
      "CONNECTIVITY",
      "LOGS"
    ]
  },
  "summary": {
    "typeCode": " Object changes when ARL changes",
    "cacheKeyHostname": "www.example.com",
    "originServerIp": "2600:1408:7400::17c7:3f1b",
    "cpCode": "668894",
    "serialNumber": "1580",
    "ttl": "Infinite",
    "edgeStatusCode": "200",
    "originResponseCode": "200",
    "edgeServerIp": "192.0.2.3",
    "originServerHostname": "www.example.com",
    "cacheSetting": "TCP_MISS",
    "domainDetails": [
      {
        "executionContext": "DEFAULT",
        "executionStatus": "SUCCESS",
        "result": {
          "answerSection": [
            {
              "hostname": "www.example.com.",
              "ttl": 82108,
              "recordClass": "IN",
              "recordType": "CNAME",
              "value": "www.example.com.edgesuite.net."
            },
            {
              "hostname": "www.example.com.edgesuite.net.",
              "ttl": 17308,
              "recordClass": "IN",
              "recordType": "CNAME",
              "value": "a1580.dscr.example.net."
            },
            {
              "hostname": "a1580.dscr.example.net.",
              "ttl": 20,
              "recordClass": "IN",
              "recordType": "A",
              "value": "192.0.2.4"
            },
            {
              "hostname": "a1580.dscr.example.net.",
              "ttl": 20,
              "recordClass": "IN",
              "recordType": "A",
              "value": "192.0.2.5"
            }
          ]
        }
      }
    ],
    "content": [
      {
        "executionContext": "DEFAULT",
        "executionStatus": "SUCCESS",
        "suggestedActions": [
          "Compare the response headers served from edge and origin.",
          "Check for content correctness.",
          "Check content length/bytes served."
        ],
        "additionalRequestParameters": {
          "requestHeaders": [
            "Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-true-cache-key, akamai-x-get-cache-key, akamai-x-serial-no, akamai-x-get-request-id"
          ]
        },
        "result": {
          "responseHeaders": {
            "Last-Modified": "Thu, 12 Feb 2015 15:44:28 GMT",
            "Content-Length": "15051"
          }
        }
      }
    ],
    "logLines": [
      {
        "executionContext": "DEFAULT",
        "executionStatus": "SUCCESS",
        "suggestedActions": [
          "Check for long times.",
          "Check content length/bytes served."
        ],
        "result": {
          "legend": {
            "logType": {
              "f": "(f) going forward to forward hostname"
            },
            "objectStatus": {
              "a": "This response was sent through the ESI processor.",
              "D": "A default object was served.",
              "x": "Either 'no-store' is turned on by metadata and not disabled by \"!no-store\" in the response or the downstream TTL was set by metadata and not by the response header.",
              "o": "The origin server was contacted for the request."
            }
          },
          "logs": [
            {
              "logType": "f",
              "timeTaken": "0",
              "objectStatus": "oaDx",
              "forwardIp": "192.0.2.10",
              "contentBytesServed": "-",
              "clientIp": "192.0.2.11",
              "edgeIp": "192.0.2.12",
              "turnaroundTime": "266"
            }
          ]
        }
      }
    ],
    "connectivity": [
      {
        "sourceContext": "EDGE_IP_CONNECTED_TO_ORIGIN",
        "destinationContext": "ORIGIN_IP",
        "executionContext": "EDGE_IP_TO_ORIGIN_IP",
        "executionStatus": "SUCCESS",
        "suggestedActions": [
          "Look for a packet loss or sudden jumps in the hop time.",
          "For a loss or latency within the end user ISP network, ask the end user to contact thier ISP.",
          "For a loss or latency within Akamai network, contact Akamai Technical Support.",
          "If a packet loss occurs at one hop but does not propogate to the end of the trace, it is irrelevant."
        ],
        "additionalRequestParameters": {
          "source": "192.0.2.13",
          "destination": "2600:1408:7400::17c7:3f1b"
        },
        "sourceIpLocation": {
          "city": "MUMBAI",
          "regionCode": "MH",
          "countryCode": "IN",
          "asNumber": 20940
        },
        "destinationIpLocation": {
          "city": "ASHBURN",
          "regionCode": "VA",
          "countryCode": "US",
          "asNumber": 20940
        },
        "result": {
          "host": "a23-212-50-38.deploy.example.com",
          "hops": [
            {
              "number": 12,
              "host": "???",
              "packetLoss": 100,
              "sentPackets": 10,
              "lastPacketLatency": 0,
              "averageLatency": 0,
              "bestRtt": 0,
              "worstRtt": 0,
              "standardDeviation": 0
            },
            {
              "number": 1,
              "host": "???",
              "packetLoss": 100,
              "sentPackets": 10,
              "lastPacketLatency": 0,
              "averageLatency": 0,
              "bestRtt": 0,
              "worstRtt": 0,
              "standardDeviation": 0
            }
          ]
        }
      }
    ]
  },
  "domainDetails": [
    {
      "executionContext": "DEFAULT",
      "executionStatus": "SUCCESS",
      "result": {
        "result": "\n; <<>> DiG 9.11.3-1ubuntu1.14aka10.0.8-Ubuntu <<>> www.example.com -t A\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27583\n;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n; COOKIE: 5ed2048bbeaf4087d1154fba6153f49926837baa0b15243d (good)\n;; QUESTION SECTION:\n;www.atcuser15.akamaiu.com.\tIN\tA\n\n;; ANSWER SECTION:\nwww.atcuser15.akamaiu.com. 82108 IN\tCNAME\twww.atcuser15.akamaiu.com.edgesuite.net.\nwww.atcuser15.akamaiu.com.edgesuite.net. 17308 IN CNAME\ta1580.dscr.akamai.net.\na1580.dscr.akamai.net.\t20\tIN\tA\t23.50.51.203\na1580.dscr.akamai.net.\t20\tIN\tA\t23.50.51.240\n\n;; Query time: 1 msec\n;; SERVER: 127.0.0.1#53(127.0.0.1)\n;; WHEN: Wed Sep 29 05:07:37 UTC 2021\n;; MSG SIZE  rcvd: 202\n\n",
        "answerSection": [
          {
            "hostname": "www.example.com.",
            "ttl": 82108,
            "recordClass": "IN",
            "recordType": "CNAME",
            "value": "www.example.com.edgesuite.net."
          },
          {
            "hostname": "www.example.com.edgesuite.net.",
            "ttl": 17308,
            "recordClass": "IN",
            "recordType": "CNAME",
            "value": "a1580.dscr.example.net."
          },
          {
            "hostname": "a1580.dscr.example.net.",
            "ttl": 20,
            "recordClass": "IN",
            "recordType": "A",
            "value": "192.0.2.14"
          },
          {
            "hostname": "a1580.dscr.example.net.",
            "ttl": 20,
            "recordClass": "IN",
            "recordType": "A",
            "value": "192.0.2.15"
          }
        ]
      }
    }
  ],
  "logLines": [
    {
      "executionContext": "DEFAULT",
      "executionStatus": "SUCCESS",
      "suggestedActions": [
        "Check for long times.",
        "Check content length/bytes served."
      ],
      "result": {
        "legend": {
          "logType": {
            "f": "(f) going forward to forward hostname"
          },
          "objectStatus": {
            "a": "This response was sent through the ESI processor.",
            "D": "A default object was served.",
            "x": "Either 'no-store' is turned on by metadata and not disabled by \"!no-store\" in the response or the downstream TTL was set by metadata and not by the response header.",
            "o": "The origin server was contacted for the request."
          }
        },
        "logs": [
          {
            "dateTime": "2021-09-29T05:07:44.733Z",
            "logType": "f",
            "hostHeader": "-",
            "referer": "-",
            "cookie": "-",
            "sslVersion": "-",
            "objectStatus": "oaDx",
            "forwardIp": "52.26.148.220",
            "userAgent": "-",
            "httpMethod": "GET",
            "error": "-",
            "edgeIp": "192.0.2.16",
            "bytesServed": "-",
            "timeTaken": "0",
            "bytesReceived": "3980",
            "objectSize": "-",
            "clientIp": "192.0.2.17",
            "httpStatus": "200",
            "contentBytesServed": "-",
            "arl": "/D/1580/668894/000/example.com/",
            "contentType": "text/html",
            "turnaroundTime": "266"
          }
        ]
      }
    }
  ],
  "content": [
    {
      "executionContext": "DEFAULT",
      "executionStatus": "SUCCESS",
      "suggestedActions": [
        "Compare the response headers served from edge and origin.",
        "Check for content correctness.",
        "Check content length/bytes served."
      ],
      "additionalRequestParameters": {
        "requestHeaders": [
          "Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-true-cache-key, akamai-x-get-cache-key, akamai-x-serial-no, akamai-x-get-request-id"
        ]
      },
      "result": {
        "httpStatusCode": 200,
        "httpVersion": "HTTP/1.1",
        "reasonPhrase": "OK",
        "responseHeaders": {
          "X-Cache": "TCP_MISS from a23-212-50-38.deploy.example.com (10.4.4-34537092) (-)",
          "X-True-Cache-Key": "/D/000/example.com/ vcd=1456",
          "Server": "Apache/2.4.7 (Ubuntu)",
          "Connection": "keep-alive",
          "X-Check-Cacheable": "NO",
          "Last-Modified": "Thu, 12 Feb 2015 15:44:28 GMT",
          "X-Akamai-Request-ID": "19e9ad97",
          "Date": "Wed, 29 Sep 2021 05:07:45 GMT",
          "X-Serial": "1580",
          "ETag": "\"3acb-50ee5fec24f00-gzip\"",
          "X-Cache-Key-Extended-Internal-Use-Only": "/D/1580/668894/000/example.com/ vcd=1456",
          "X-Cache-Key": "/D/1580/668894/000/example.com/",
          "Content-Length": "15051",
          "Content-Type": "text/html"
        }
      }
    }
  ],
  "connectivity": [
    {
      "sourceContext": "EDGE_IP_CONNECTED_TO_ORIGIN",
      "destinationContext": "ORIGIN_IP",
      "executionContext": "EDGE_IP_TO_ORIGIN_IP",
      "executionStatus": "SUCCESS",
      "suggestedActions": [
        "Look for a packet loss or sudden jumps in the hop time.",
        "For a loss or latency within the end user ISP network, ask the end user to contact thier ISP.",
        "For a loss or latency within Akamai network, contact Akamai Technical Support.",
        "If a packet loss occurs at one hop but does not propogate to the end of the trace, it is irrelevant.",
        "If source Ip country and destination IP country is same then there should not be any hops outside the country."
      ],
      "additionalRequestParameters": {
        "source": "192.0.2.15",
        "destination": "192.0.2.16"
      },
      "sourceIpLocation": {
        "city": "MUMBAI",
        "regionCode": "MH",
        "countryCode": "IN",
        "asNumber": 20940
      },
      "destinationIpLocation": {
        "city": "ASHBURN",
        "regionCode": "VA",
        "countryCode": "US",
        "asNumber": 20940
      },
      "result": {
        "startTime": 1632892100,
        "host": "a23-212-50-38.deploy.example.com",
        "packetLoss": 0,
        "averageLatency": 204.1,
        "result": "Start: 2021-09-29T05:08:20+0000\nHOST: a23-212-50-38.deploy.example.com                                                               Loss%   Snt   Last   Avg  Best  Wrst StDev\n  1.|-- ???                                                                                                       100.0    10    0.0   0.0   0.0   0.0   0.0\n  2.|-- 2403:0:100::911                                                                                            0.0%    10    0.4   0.4   0.3   0.5   0.1\n  3.|-- if-ae-1-101.tcore2.mlv-mumbai.ipv6.as6453.net (2001:5a0:2300:300::1)                                       0.0%    10    8.4   2.5   0.4  10.3   3.7\n  4.|-- if-ae-12-2.tcore1.l78-london.ipv6.as6453.net (2001:5a0:2300:300::15)                                       0.0%    10  128.3 138.9 125.2 216.0  28.0\n  5.|-- if-ae-15-2.tcore3.njy-newark.ipv6.as6453.net (2001:5a0:2000:400::22)                                       0.0%    10  196.7 198.9 195.0 210.5   4.5\n  6.|-- if-ae-1-3.tcore4.njy-newark.ipv6.as6453.net (2001:5a0:f00::24)                                             0.0%    10  199.4 199.6 196.6 201.4   1.4\n  7.|-- if-ae-12-2.tcore3.aeq-ashburn.ipv6.as6453.net (2001:5a0:600:500::16)                                       0.0%    10  206.5 206.4 204.3 216.0   3.5\n  8.|-- 2001:5a0:600:502::2                                                                                        0.0%    10  204.4 204.5 201.9 206.6   1.6\n  9.|-- ae1.r01.iad01.icn.netarch.akamai.com (2600:1488:a180:125::a)                                               0.0%    10  205.1 205.7 200.4 209.4   2.3\n 10.|-- ae3.r01.iad03.icn.netarch.akamai.com (2600:1488:5fc3:4d::b)                                                0.0%    10  206.6 205.1 200.2 214.0   4.3\n 11.|-- ae5.r01.iad03.ien.netarch.akamai.com (2600:1488:a181:111::b)                                               0.0%    10  205.2 205.2 196.3 219.4   6.0\n 12.|-- ???                                                                                                       100.0    10    0.0   0.0   0.0   0.0   0.0\n 13.|-- g2600-1408-7400-0000-0000-0000-17c7-3f1b.deploy.static.akamaitechnologies.com (2                           0.0%    10  200.7 204.1 200.3 205.9   2.0\n",
        "hops": [
          {
            "number": 1,
            "host": "???",
            "packetLoss": 100,
            "sentPackets": 10,
            "lastPacketLatency": 0,
            "averageLatency": 0,
            "bestRtt": 0,
            "worstRtt": 0,
            "standardDeviation": 0
          },
          {
            "number": 2,
            "ip": "192.0.2.17",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 0.4,
            "averageLatency": 0.4,
            "bestRtt": 0.3,
            "worstRtt": 0.5,
            "standardDeviation": 0.1,
            "ipLocation": {
              "city": "MUMBAI",
              "regionCode": "MH",
              "countryCode": "IN",
              "asNumber": 4755
            }
          },
          {
            "number": 3,
            "host": "if-ae-1-101.tcore2.mlv-mumbai.ipv6.as6453.net",
            "ip": "192.0.2.18",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 8.4,
            "averageLatency": 2.5,
            "bestRtt": 0.4,
            "worstRtt": 10.3,
            "standardDeviation": 3.7,
            "ipLocation": {
              "city": "MUMBAI",
              "regionCode": "MH",
              "countryCode": "IN",
              "asNumber": 6453
            }
          },
          {
            "number": 4,
            "host": "if-ae-12-2.tcore1.l78-london.ipv6.as6453.net",
            "ip": "192.0.2.19",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 128.3,
            "averageLatency": 138.9,
            "bestRtt": 125.2,
            "worstRtt": 216,
            "standardDeviation": 28,
            "ipLocation": {
              "city": "LONDON",
              "regionCode": "EN",
              "countryCode": "GB",
              "asNumber": 6453
            }
          },
          {
            "number": 5,
            "host": "if-ae-15-2.tcore3.njy-newark.ipv6.as6453.net",
            "ip": "192.0.2.20",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 196.7,
            "averageLatency": 198.9,
            "bestRtt": 195,
            "worstRtt": 210.5,
            "standardDeviation": 4.5,
            "ipLocation": {
              "city": "NEWYORK",
              "regionCode": "NY",
              "countryCode": "US",
              "asNumber": 6453
            }
          },
          {
            "number": 6,
            "host": "if-ae-1-3.tcore4.njy-newark.ipv6.as6453.net",
            "ip": "192.0.2.21",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 199.4,
            "averageLatency": 199.6,
            "bestRtt": 196.6,
            "worstRtt": 201.4,
            "standardDeviation": 1.4,
            "ipLocation": {
              "city": "NEWARK",
              "regionCode": "NJ",
              "countryCode": "US",
              "asNumber": 6453
            }
          },
          {
            "number": 7,
            "host": "g2600-1408-7400-0000-0000-0000-17c7-3f1b.deploy.static.example.com",
            "packetLoss": 0,
            "sentPackets": 10,
            "lastPacketLatency": 200.7,
            "averageLatency": 204.1,
            "bestRtt": 200.3,
            "worstRtt": 205.9,
            "standardDeviation": 2
          }
        ]
      }
    }
  ]
}
```

# Set up authorization



Before you can use this API, you need to [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials). 

Then, you can use these code samples to apply the token values to your requests.

# Fetch the edge server location

<!-- curl@9 -->
<!-- node@21 -->
<!-- python@21 -->

Fetch the `edgeLocationId` value of the location closest to your users experiencing issues. Run the [List available edge server locations](https://techdocs.akamai.com/edge-diagnostics/reference/get-edge-locations) operation to get this value.

# Fetch the edge server IP

<!-- curl@8 -->
<!-- node@20 -->
<!-- python@20 -->

Fetch the `spoofEdgeIp` value. This is the IP of the edge server you want to serve traffic from. You can run the [Get domain details with dig](https://techdocs.akamai.com/edge-diagnostics/reference/post-dig) operation for the A record type. Use a returned IP value from the `answerSection` array.

# Provide the URL

<!-- curl@7 -->
<!-- node@19 -->
<!-- python@19 -->

Provide the URL you want to run the health check for.

# Specify required data

<!-- curl@17-20 -->
<!-- node@29-32 -->
<!-- python@29-32 -->

Specify whether you want to also get GREP and MTR data. For GREP, add `LOGS` to the `viewsAllowed` array and for MTR, `CONNECTIVITY`.

# Specify the IP version

<!-- curl@10 -->
<!-- node@22 -->
<!-- python@22 -->

Specify the IP version for the URL health check to use to run cURL and MTR, either `IPV4` or `IPV6`.

# Specify the port

<!-- curl@11 -->
<!-- node@23 -->
<!-- python@23 -->

If you added `CONNECTIVITY` to the `viewsAllowed` array, specify the port to use to run MTR, either `80` or `443`.

# Provide the packet type

<!-- curl@12 -->
<!-- node@24 -->
<!-- python@24 -->

If you added `CONNECTIVITY` to the `viewsAllowed` array, specify the packet type used by MTR, either `ICMP` or `TCP`.

# Specify the DNS record type

<!-- curl@13 -->
<!-- node@25 -->
<!-- python@25 -->

Specify the DNS record type you want to get. Possible values are: `A` for IPv4 address record, `AAAA` for IPv6 address record, `SOA` for Start of Authority record, `CNAME` for Canonical Name record, `PTR` for Pointer record, `MX` for Mail Exchanger record, `NS` for Nameserver record, `TXT` for Text record, `SRV` for Service Location record, `CAA` for Certificate Authority Authorization record, and `ANY`.

# Add request headers

<!-- curl@14-16 -->
<!-- node@26-28 -->
<!-- python@26-28 -->

Add customized headers for the cURL request in the format `header: value`. [Akamai Pragma headers](https://techdocs.akamai.com/edge-diagnostics/docs/pragma-headers) are added by default.

# Call the API

<!-- curl@1-100 -->
<!-- node@1-100 -->
<!-- python@1-100 -->

Call POST on the request URL, providing the object in the body of the request.

# Review the response



The response returns 202 status. Successful operations return fetched GREP, dig, cURL, and MTR data. For operations in progress, the returned object contains `retryAfter`, `requestId`, and `link`. In this case, wait for the duration of the `retryAfter` interval and use the `requestId` to run the [Get a URL health check response](https://techdocs.akamai.com/edge-diagnostics/reference/get-url-health-check-requests) operation or simply GET the `link`.