Network

Ping Host

0calls
1 credits / call

Want to know if the network latency from our server to your server is high? This tool can help you test network connectivity.

GET
uapis.cn
/api/v1/network/ping
Query parameters
1
host
string
required

The target host you need to Ping, which can be a domain name or IP address.

Overview

This endpoint will perform an ICMP Ping operation from our server node to the host (domain name or IP address) you specify. It returns key metrics such as minimum, maximum, average latency and packet loss rate, making it a powerful tool for diagnosing network issues.

Query parameters

host
stringrequired

The target host you need to Ping, which can be a domain name or IP address.

Response

200 / OK

Ping operation successful! Returns latency statistics.

JSON
{
  // Average latency (ms)
  "avg": 1.25,
  "host": "cn.bing.com",
  "ip": "142.250.191.78",
  "location": "United States",
  // Maximum latency (ms)
  "max": 2.1,
  // Minimum latency (ms)
  "min": 0.89
}

400 / Bad Request

Request failed, invalid parameters or target unreachable. Frontend can directly display the message field.

Possible reasons:

  • Unable to resolve host: The host parameter is an invalid domain name or IP address.
    JSON
    {
        "code": "INVALID_PARAMETER",
        "message": "Unable to resolve host 'invalid hostname', please check if the input is correct."
    }
  • Ping timeout: The target host is unreachable or blocked by firewall.
    JSON
    {
        "code": "INVALID_PARAMETER",
        "message": "Ping request to host 'target host' timed out, target may be unreachable or blocked by firewall."
    }
JSON
{
  "code": "INVALID_PARAMETER",
  "message": "Unable to resolve host 'invalid hostname', please check if the input is correct."
}

429 / Too Many Requests

Service busy. When there are too many server Ping requests, rate limiting will be triggered. Frontend can directly display the message field.

JSON
{
    "code": "SERVICE_BUSY",
    "message": "Ping service is busy, please try again later."
}
JSON
{
  "code": "SERVICE_BUSY",
  "message": "Ping service is busy, please try again later."
}