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>"

Latency vs. measurements. The latency endpoints are a low-latency, cached read of continuous probe data (no command runs) — ideal for status widgets. /measurements runs an on-demand diagnostic and is asynchronous.

Endpoints

POST /api/v1/measurements

Run a measurement. Body: { location, type, target }. Returns 201 with the measurement id and status.

GET /api/v1/measurements

List your measurements (newest first, paginated). Filter with ?location=&type=&status=.

GET /api/v1/measurements/{id}

Fetch a measurement's status and, once complete, its output and exit code.

GET /api/v1/latency

Current cached latency for every location, with status (excellent/good/fair/slow).

GET /api/v1/latency/{node}

Current cached latency for a single location.

GET /api/v1/latency/{node}/stats

Average / min / max latency per endpoint over a window (?window= seconds).

GET /api/v1/nodes

List your locations with status (online/offline/disabled), geo, enabled methods, and agent version.

GET /api/v1/nodes/{node}

Status and details for a single location.

Measurement types

type is one of ping, ping6, traceroute, traceroute6, mtr, mtr6, or bgp. Diagnostic targets must be a public IPv4/IPv6 address or hostname; a bgp target is a public IP or CIDR prefix (e.g. 8.8.8.0/24). Private and reserved ranges (RFC1918, loopback, link-local, cloud metadata) are rejected.

BGP runs from a location's own routing daemon when it has one, otherwise the control plane resolves it against RIPE RIS for a global view. Requires the BGP plan feature.

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.