docs / get /api/stats

GET /api/stats

Public aggregate network stats. The landing page hero ticker, the /status dashboard, and any third-party uptime / growth tracker can pull from this endpoint.

The underlying Nostr scan is heavy-cached (10 minutes) because it queries every configured discovery relay. The response includes a cached_at timestamp and window_minutes so consumers can show freshness.

GET https://ochk.io/api/stats

No parameters.

Response (200)

{
  "cached_at":      "2026-04-21T12:00:00Z",
  "window_minutes": 10,
  "attestations": {
    "total":     142,
    "by_scheme": { "bip322": 139, "legacy": 3 }
  },
  "identities": {
    "total_bindings": 384,
    "by_protocol": {
      "nostr":   185,
      "github":  102,
      "twitter": 61,
      "dns":     36
    }
  },
  "addresses": {
    "unique": 127
  },
  "bond": {
    "sampled":            48,
    "median_sats":        500000,
    "p90_sats":           5000000,
    "total_declared_sats": 78400000
  },
  "relays": [
    "wss://relay.damus.io",
    "wss://relay.nostr.band",
    "wss://nos.lol"
  ],
  "featured": {
    "attestation_id": "a3f5b8c2…",
    "address":        "bc1q...",
    "scheme":         "bip322",
    "issued_at":      "2026-04-21T11:43:00Z"
  },
  "service": {
    "uptime_seconds": 782341,
    "environment":    "production",
    "version":        "0.1.0"
  }
}

Fields

FieldNotes
cached_atWhen the Nostr scan was last run.
window_minutesCache TTL — consumers can label as "updated N minutes ago".
attestations.totalDistinct proofs seen across relays.
attestations.by_schemeBreakdown by bip322 / legacy.
identities.total_bindingsSum of handle bindings across attestations.
identities.by_protocolBreakdown by handle protocol.
addresses.uniqueDistinct Bitcoin addresses that have published at least one proof.
bond.sampledHow many attestations carried a bond: we could read.
bond.median_sats / p90_satsBond-value summary stats.
bond.total_declared_satsSum of all declared bonds. Advisory — not verified against chain state.
relaysNostr relays scanned.
featuredMost-recently-issued attestation. Nullable.
service.uptime_secondsHosted-verifier process uptime.
service.environmentproduction / development.
service.versionnpm_package_version of the verifier.

Example

curl "https://ochk.io/api/stats" | jq '.attestations.total'
const r = await fetch('/api/stats');
const { attestations, addresses, identities } = await r.json();

Behavior notes

  • Not verified. The stats are summarised directly from Nostr events — no signature verification or chain-state recomputation per row. For authoritative per-row data, call /api/check with the address or ID.
  • Cache warm time. First request after TTL expiry triggers a full Nostr scan; can take 10–30 s depending on relay latency. Subsequent requests within the window return cached data in milliseconds.
  • Featured attestation is the most recent by issued_at. The landing-page hero uses this to render a live proof card.

Rate limit

30 req/min per IP.

Status codes

HTTPMeaning
200Stats returned.
429Rate limited.
500Server error (falls back to stale cache when available).