Access the Globalping Production API
masterapi.globalping.io. This endpoint serves as the central gateway for interacting with the Globalping platform.repository·master·Indexed 20 days ago
https://github.com/jsdelivr/globalpingA platform for running networking commands like ping, traceroute, and DNS lookups from a globally distributed network of probes. Includes documentation for the globalping-api (v1.0.0), CLI installation, Slack app integration, REST API usage, and instructions for hosting probes via Docker. Covers probe location targeting using the 'magic' field, system tags for network types, and platform usage limits.
api.globalping.io. This endpoint serves as the central gateway for interacting with the Globalping platform.To maintain performance and security, Globalping applies technical and operational limits to the Services, including probe hosting.
Key details for users:
Globalping uses a consistent command structure across its CLI, Slack app, and other integrations. This allows you to switch between tools without relearning syntax.
Command Syntax:
globalping [command] [target] from [location] [flags]
Components:
ping, traceroute, mtr, dns (similar to dig), and http (similar to curl GET and HEAD).AS, e.g., from AS80085). You can also use measurement IDs from previous tests to reuse specific probes.--limit to control the number of probes used.globalping ping google.com from aws
globalping ping google.com from Berlin, South America --limit 2You can instruct the API to use the same probes from a previous measurement by providing its measurement ID in the magic field. This is useful for benchmarking, troubleshooting, or emulating continuous pings.
Example usage:
from WZIAtMx4LLhzit02
IMPORTANT This is a best-effort action. If probes are offline or the measurement has expired, they will be missing from the new results. Do not hard-code measurement IDs in production as they expire.
from WZIAtMx4LLhzit02The Globalping platform relies on several key infrastructure components hosted primarily on Hetzner in Falkenstein:
api.globalping.io): The central entry point for users and probes.maxmemory-policy allkeys-lru and has the RedisJSON 2.x module enabled.*.globalping.io.Liability terms vary depending on whether you are using Globalping as a consumer or a business user:
Globalping enforces several limits to prevent abuse and ensure sustainability. Limits are categorized by authentication status and apply to IP addresses or specific API keys.
These apply to all users per IP address:
Users without an API key are subject to the following limits per IP address:
Note: A 'test' is defined as a successful measurement run from one probe. For example, a limit of 10 tests allows either 10 measurements with 1 probe each, or 1 measurement with 10 probes.
The Globalping Geo IP algorithm determines the location of a probe by aggregating data from multiple providers and applying approximation and prioritization logic. This ensures a high-confidence location even when individual providers return imprecise data.
ipinfo, ip2location, maxmind, ipmap, and fastly. Results that are errors or not found are filtered out.dc-cities.json list. If not, it performs a city approximation:country are grouped together and prioritized.city are grouped together.["ipinfo", "ip2location", "maxmind", "ipmap", "fastly"] (where ipinfo is highest).ipinfo > ip2location > maxmind > ipmap > fastly
// Example of the final output structure after the algorithm runs
{
"ipinfo": {
"country": "US",
"city": "San Jose",
"lat": 37.323,
"long": -122.03218,
"asn": "0001"
}
}Globalping uses a "magic" field to parse location inputs across all integrations (CLI, Slack, Web, API). This allows for a consistent user experience when specifying where tests should originate. The magic parser supports various parameters including:
usa, europe, western europenew york, california, frankfurtaws, us-east-2, gcp-us-south1as396982 (ASN), comcast (ISP), eyeball-network, datacenter-networkIf no location is provided, the system defaults to world, which uses a pseudo-random algorithm to select probes proportionally across continents (e.g., aiming for specific proportions in Africa, Asia, Europe, etc.).
You can contribute to the Globalping network by running a probe on your own infrastructure using spare capacity. This helps expand the seeded datacenter network which currently includes providers like Google Cloud, AWS, DigitalOcean, Vultr, OVH, Fly.io, and Tencent.
For instructions on how to set up and run a probe, refer to the globalping-probe repository.
To run the API staging environment, you will set up two API instances behind an HAProxy load balancer on port 80.
Key Configuration Details:
TEST_MODE=perf instructs the API to use the fake IP provided by the probe.Steps:
REDIS_PASSWORD and REDIS_HOST.haproxy with a round-robin backend targeting ports 3001 and 3002.globalping repository.3001 and 3002 using the environment variables provided in the example.# Update that variables before start
REDIS_PASSWORD=<your_value>
REDIS_HOST=<your_value>
# Install haproxy
sudo apt-get update
sudo apt -y install haproxy
# Configure and start haproxy
sudo chmod a+w /etc/haproxy/haproxy.cfg
cat <<EOF | sudo tee -a /etc/haproxy/haproxy.cfg > /dev/null
frontend gp_fe
bind *:80
default_backend gp_be
backend gp_be
balance roundrobin
option httpchk GET /health
server server1 127.0.0.1:3001 check
server server2 127.0.0.1:3002 check
EOF
sudo systemctl stop haproxy
sudo systemctl start haproxy
# Install node
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=24
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
# Copy and build the repository
git clone https://github.com/jsdelivr/globalping.git
cd globalping/
npm i
npm run build
# Run the app
echo 'Run 2 app instances using:
PORT=3001 HOSTNAME=3001 REDIS_URL=redis://default:$REDIS_PASSWORD@$REDIS_HOST:6379 NODE_ENV=production ADMIN_KEY=admin TEST_MODE=perf NEW_RELIC_ENABLED=false NEW_RELIC_LOG_ENABLED=false node dist/index.js
and
PORT=3002 HOSTNAME=3002 REDIS_URL=redis://default:$REDIS_PASSWORD@$REDIS_HOST:6379 NODE_ENV=production ADMIN_KEY=admin TEST_MODE=perf NEW_RELIC_ENABLED=false NEW_RELIC_LOG_ENABLED=false node dist/index.js
'By registering on the Globalping Dashboard, you receive an API key that grants higher usage limits than unauthenticated access:
Registered users who host probes receive 150 credits per day for each probe.
As a GitHub Sponsor of jsDelivr, you receive an additional 2000 credits for every dollar donated.