Getting machine-readable capabilities from a Nostr relay URL
An operator opens a relay domain in a browser and sees a landing page. The capability document can live on exactly the same path: the HTTP request must ask for its media type.
Request metadata from the WebSocket endpoint’s HTTP counterpart
Set RELAY_HTTPS to the HTTPS form of the relay’s WSS URL, preserving any path. This command asks for NIP-11 JSON and selects the fields used by a client capability panel. If the result is HTML or jq reports a parse error, inspect the response headers and check whether the reverse proxy forwards the Accept header.
curl -fsS -H 'Accept: application/nostr+json' "$RELAY_HTTPS" |
jq '{name, supported_nips, limitation}'
Distinguish an omitted field from a zero limit
A relay may omit fields. Represent a missing limitation object as unknown. Translating it into a zero subscription allowance would disable the client before it attempts a connection. A listed NIP is the operator’s declaration of support. For an interoperability incident, capture the relay’s actual WebSocket response to the operation as well.