Query aggregated NIP-66 relay data over HTTP with rstate. Supports relay search, geo queries, pagination, and label filtering. No Nostr knowledge required.
Use this file to discover all available pages before exploring further.
The rstate REST API provides standard HTTP endpoints for querying aggregated NIP-66 relay monitoring data. rstate is the aggregation engine at the core of nostr-watch: it ingests raw NIP-66 events from multiple independent monitors, computes consensus values using configurable quorum and MAD-based outlier detection, and serves the results as a REST API. No Nostr knowledge or special libraries are required.
When self-hosting, the default is http://localhost:3000. Enable the REST API by setting REST_ENABLED=true in your environment, or rest.enabled: true in config.yaml. Interactive OpenAPI documentation and a live sandbox are available at api.nostr.watch/v2/, and at /docs when running rstate locally.
# Health checkcurl -s https://api.nostr.watch/v2/health/ping | jq '.'# List first 10 relays sorted by most recently updatedcurl 'https://api.nostr.watch/v2/relays?limit=10&sortBy=updated&sortOrder=desc'# Get state for a specific relaycurl 'https://api.nostr.watch/v2/relays/state?relayUrl=wss%3A%2F%2Frelay.damus.io'# Search for relays supporting NIP-42curl -X POST https://api.nostr.watch/v2/relays/search \ -H "Content-Type: application/json" \ -d '{"nips": [42]}'# Find relays near San Franciscocurl 'https://api.nostr.watch/v2/relays/nearby?lat=37.7749&lon=-122.4194&radius=100'# Get online relayscurl -X POST https://api.nostr.watch/v2/relays/online \ -H "Content-Type: application/json" \ -d '{}'
Most REST endpoints are public and unauthenticated. The only endpoint requiring authentication is PUT /policy, which uses NIP-98 HTTP Auth — create a signed Nostr event (kind 27235) and pass it as a Bearer token.The API uses rate limiting to prevent abuse. Default: 10 requests per second, max burst 100. When rate limited, you will receive a 429 Too Many Requests response with a Retry-After header.
The REST API serves aggregated data. When using a third-party REST API, you trust that the operator is running an honest rstate instance. To eliminate this trust requirement, self-host rstate (set REST_ENABLED=true) or use raw NIP-66 events to verify data independently.
The aggregation logic is open source. Self-hosting rstate means you ingest raw NIP-66 events directly from Nostr relays and compute results locally — no trust in nostr.watch required.