Overview

The peers API is a read-only JSON API intended for Yggdrasil software developers and tools that need programmatic access to peer data. It returns the same data shown on the main page, with optional filtering by country, protocol, and status.

No authentication is required. All responses are application/json.

Endpoint

GET /api/v1/peers

Returns a list of all known public peers, with optional filtering.

Query parameters

All parameters are optional and can be combined freely.

Parameter Type Description
country string Filter by country name or ISO 3166-1 alpha-2 code. Case-insensitive (e.g. germany, United States, de, US).
protocol string Filter by protocol. Case-insensitive. One of: tcp, tls, quic, ws, wss, socks, sockstls.
status string Filter by effective reachability: up, down, or unknown. The obsolete is_up parameter is rejected with HTTP 400.
is_network boolean Filter by peer type. false returns regular public peers; true returns overlay network peers (e.g. Hyperboria).

Response format

The response is a JSON object with metadata and a peers array. Counts reflect the filtered result set, not the full database.

Breaking contract change: JSON and CSV replace the old boolean reachability field with status and explicit freshness and distributed-probe coverage. Unknown never means offline.

{
  "updated_at":  "2025-01-01T12:00:00Z",  // time this response was generated (UTC)
  "window_days": 7,                        // uptime window used for uptime_pct
  "total":       142,                      // total peers in this response
  "online":      98,                       // peers currently reachable
  "offline":     30,                       // all eligible probes reported failure
  "unknown":     14,                       // incomplete, missing, or expired evidence
  "peers": [
    {
      "uri":              "tls://example.com:8001",  // full connection URI
      "country":          "DE",
      "protocol":         "tls",
      "host":             "example.com",
      "port":             8001,
      "status":           "up",            // up, down, or unknown
      "is_network":       false,           // true for overlay network peers
      "state_changed_at": "2025-01-01T11:30:00Z",  // last effective status change, including expiry (or null)
      "last_checked_at":  "2025-01-01T11:59:00Z",  // server measurement time (or null)
      "status_valid_until": "2025-01-01T12:06:00Z", // expiry (or null)
      "last_round_id":    42,              // published measurement round (or null)
      "successful_probes": 2,              // successful probes in that round
      "reporting_probes":  3,              // eligible probes reporting
      "expected_probes":   3,              // eligible probes expected
      "registered_probes": 4,              // registered enabled probes in the round
      "uptime_pct":       98.21,           // known rounds up / all known rounds (or null)
      "coverage_pct":     92.50            // known rounds / all rounds (or null)
    },
    ...
  ]
}

Examples

All peers (no filter)

/api/v1/peers

Only peers currently online

/api/v1/peers?status=up

Online TLS peers, excluding overlay networks

/api/v1/peers?protocol=tls&status=up&is_network=false

Unknown or expired reachability

/api/v1/peers?status=unknown

Bulk export

If you need a one-off snapshot of all peers without filtering, two export formats are available:

All peers as JSON (same shape as the API, no filters)

/peers.json

All peers as CSV (column headers match JSON field names)

/peers.csv

CSV has one row per peer with the same scalar fields as JSON. Optional timestamps, round IDs, and percentages are blank when absent. Probe counts are snapshots of the published round, not the current registry.

The CSV response includes two response headers carrying the metadata that the JSON envelope provides inline:

HeaderExampleDescription
X-Updated-At 2025-01-01T12:00:00Z Time the response was generated (UTC, RFC 3339).
X-Window-Days 7 Uptime window used for the uptime_pct column.

HTTP status codes

StatusMeaning
200 OKSuccessful response. Body is JSON.
400 Bad RequestA query parameter has an invalid value. Body is {"error": "..."}.
500 Internal Server ErrorServer-side failure. Body is plain text.

Notes