API reference
A token-authenticated REST API to run measurements and read cached latency. Available on Pro and Enterprise.
Authentication
Create a token in the portal (API section) and send it as a Bearer token. The base URL is your looking glass host.
curl https://your-org.bgpglass.com/api/v1/latency \ -H "Authorization: Bearer <token>"
Endpoints
POST /api/v1/measurements
Run a measurement. Body: { location, type, target }. Returns 201 with the measurement id and status.
GET /api/v1/measurements/{id}
Fetch a measurement's status and, once complete, its output and exit code.
GET /api/v1/latency
Cached latency for every location, with status (excellent/good/fair/slow).
GET /api/v1/latency/{node}
Cached latency for a single location.
Measurement types
type is one of
ping, ping6,
traceroute, traceroute6,
mtr, mtr6.
Targets must be a public IPv4/IPv6 address or hostname — private and reserved
ranges (RFC1918, loopback, link-local, cloud metadata) are rejected.
iperf3 is not a measurement type: each location can host an iperf3 speed-test server you connect to directly. The connect command appears on the looking glass page and is set up in self-hosting.
Run a measurement
curl -X POST https://your-org.bgpglass.com/api/v1/measurements \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"location":"frankfurt","type":"ping","target":"1.1.1.1"}'
# → 201
{
"data": {
"id": "01J...",
"status": "queued",
"type": "ping",
"target": "1.1.1.1",
"location": "frankfurt"
}
}
Measurements are asynchronous — poll GET /api/v1/measurements/{id} until status is done or failed, then read output. Requests are rate-limited per your plan. Real-time BGP route queries are coming soon.