Back to Rankings FAQ

NymRank API

JSON over HTTP. Below: reference for each route, then a live request panel. Base path is this host (e.g. /api/status).

Conventions

Format. Responses use application/json. Successful bodies are plain objects (no data wrapper).

Errors. Failed requests return an object { "error": { "code": "<string>", "message": "<string>" } } with an appropriate HTTP status (400, 404, 500, 503, etc.).

Pubkey parameters. Path segments named :pubkey accept either a 64-character lowercase hex pubkey or an npub1… bech32 string (URL-encoded when used in a path).

GET /api/status

Lightweight readiness check: runs SELECT 1 against PostgreSQL and returns process uptime.

StatusBody
200ok, service (nymrank-api), uptime_seconds
503db_unavailable — database not reachable
Try it
{}

GET /api/names/:name

Resolve whether a display name (and related nip05/lud16-style matches) is already associated with a ranked user. Only considers committee perspectives with rank_value ≥ 35 and requires a strong name match (affinity ≥ 2).

ParameterDescription
namePath segment: trimmed and lowercased on the server.

200 — available

{ "name": "alice", "available": true, "occupant": null }

200 — taken

{ "name": "alice", "available": false, "occupant": { "pubkey", "average_rank", "name_affinity", "profile": { "name", "nip05", "lud16" } } }
Statuserror.code
400invalid_name
500internal_error
Try it
{}

GET /api/users/:pubkey/rank

Aggregated reputation for one user: averaged rank and influence metrics across committee rows, plus per-committee breakdown.

ParameterDescription
pubkeyHex or npub (URL-encoded in path).

200 — includes pubkey, average_rank, average_influence_score, average_hops, average_follower_count, perspective_count, profile (name, nip05, lud16, name_affinity), committee_breakdown (array of rows).

Statuserror.code
400invalid_pubkey
404not_found — no ranking row for this pubkey
500internal_error
Try it
{}

GET /api/users/:pubkey/activity

Ad-hoc pass over configured social relays: fetch recent events by this author (any kind), refresh kind 0 profile if present, and update profile_refresh_queue / activity timestamps in the database. Heavier than read-only APIs; may take a few seconds.

200pubkey (hex), latest_event (most recent relay event or null), total_events_found, profile (row from user_names + queue timestamps, or null if no profile row).

Statuserror.code
400invalid_pubkey
500internal_error — relay or processing failure
Try it
{}