🚀 Experience the new and improved APIVoid! Check out what's new
A JSON API to run ping network tests from multiple worldwide locations. Use this API to test the latency and reachability of your website from multiple geo locations, simplify the troubleshoot of potential network connectivity and speed issues from specific locations.
Consumes 5 credits per API call
# Example Curl request from the command line:
curl -X POST "https://api.apivoid.com/v2/ping-test" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-d '{"host":"google.com"}'
# Example JSON output for a 200 HTTP status code:
{
"host": "google.com",
"locations": [
{
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"city_name": "San Francisco",
"ping_output": {
"host": "google.com",
"ip_address": "142.251.46.238",
"ip_hostname": "sfo03s27-in-f14.1e100.net",
"is_valid_ip": true,
"is_private_ip": false,
"is_loopback_ip": false,
"is_reserved_ip": false,
"packets_sent": 3,
"packets_received": 3,
"percent_packet_loss": 0,
"icmp_requests": [
{
"bytes": 64,
"icmp_seq": 1,
"ttl": 117,
"time_ms": 0.977
},
{
"bytes": 64,
"icmp_seq": 2,
"ttl": 117,
"time_ms": 0.689
},
{
"bytes": 64,
"icmp_seq": 3,
"ttl": 117,
"time_ms": 0.454
}
],
"rtt": {
"min": 0.454,
"avg": 0.706,
"max": 0.977,
"mdev": 0.213
},
"elapsed_ms": 2018
},
"error": ""
},
{
"continent_code": "AS",
"continent_name": "Asia",
"country_code": "IN",
"country_name": "India",
"city_name": "Bangalore",
"ping_output": {
"host": "google.com",
"ip_address": "142.250.70.110",
"ip_hostname": "pnbomb-ac-in-f14.1e100.net",
"is_valid_ip": true,
"is_private_ip": false,
"is_loopback_ip": false,
"is_reserved_ip": false,
"packets_sent": 3,
"packets_received": 3,
"percent_packet_loss": 0,
"icmp_requests": [
{
"bytes": 64,
"icmp_seq": 1,
"ttl": 118,
"time_ms": 18
},
{
"bytes": 64,
"icmp_seq": 2,
"ttl": 118,
"time_ms": 17.5
},
{
"bytes": 64,
"icmp_seq": 3,
"ttl": 118,
"time_ms": 17.3
}
],
"rtt": {
"min": 17.262,
"avg": 17.594,
"max": 17.999,
"mdev": 0.305
},
"elapsed_ms": 2022
},
"error": ""
},
...
],
"elapsed_ms": 3279
}
Key Features
Businesses and startups use this Ping Test API to run ping network tests from multiple locations and check their website, IP addresses, API endpoints, load balancers and CDN latency and speed.
New York, San Francisco, Toronto, Singapore, Sydney, Bangalore, Frankfurt, London, Amsterdam.
You can test any website from multiple locations and get the ping stats within 2-3 seconds.
The JSON data includes the packets sent, received and lost, and the round trip time (RTT) stats min/avg/max.
Easily troubleshoot network latency and connectivity issues with our API from your platform.
Common Use Cases
Our API can be used in many ways, from server administration tasks to network diagnostic tasks. Here we showcase the most popular use cases according to our customers usage:
Test the network latency and RTT of your website from multiple global locations with ease.
Provide a multi-location ping test tool to your customers integrated directly within your platform.
You can use this ping JSON API to test the latency (ms) of your website, CDN, load balancer, IP address.
Check the latency of your website, find out why it is slow from X location, fix the issue and re-test it.
USAGE EXAMPLE
All it takes is a HTTPS POST request with JSON payload to our endpoint, and you’ll receive the response within seconds, usually within 2-3 seconds. Here are a few code examples to use the API:
$host = 'google.com';
$apiUrl = 'https://api.apivoid.com/v2/ping-test';
$apiKey = 'your_api_key_here';
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['host' => $host]));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$responseData = json_decode($response, true);
print_r($responseData);
}
Create your account, pick a subscription plan, and make your first API call instantly with your API key—simple as that!
Get started now