# Nostr API
> Live profile and notes for any Nostr account, read straight from the open Nostr relay network — no key, no account, nothing cached. Nostr is the decentralised, censorship-resistant social protocol with no central server, so this service queries several public relays in parallel and merges and de-duplicates what they return. Give it a public key, either as 64-character hex or as an npub… key (it decodes bech32 npub keys for you), and the profile endpoint returns the account's kind-0 metadata: name, display name, about/bio, picture, banner, website, NIP-05 verified identifier and Lightning address — fiatjaf's key resolves to name "fiatjaf", NIP-05 _@fiatjaf.com. The notes endpoint returns the account's most recent kind-1 text notes — the posts — newest first and de-duplicated across relays, each with its content, timestamp, note id and mention and reply counts. The relays endpoint lists the public relays queried. This is the profile-and-posts layer for any Nostr client, bot, indexer or social dashboard — live from the relay network, nothing stored. Distinct from centralised-platform social APIs — this reads the open Nostr protocol directly from its relays. 4 endpoints.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/nostr-api/..."
```

## Pricing
- **Free** (Free) — 12,000 calls/Mo, 3 req/s
- **Starter** ($7/Mo) — 150,000 calls/Mo, 8 req/s
- **Pro** ($18/Mo) — 700,000 calls/Mo, 15 req/s
- **Scale** ($41/Mo) — 3,500,000 calls/Mo, 30 req/s

## Endpoints

### Nostr

#### `GET /v1/notes` — Account recent notes

**Parameters:**
- `pubkey` (query, required, string) — Public key: 64-hex or npub1… Example: `3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d`
- `limit` (query, optional, string) — Number of notes (default 20, max 50) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nostr-api/v1/notes?pubkey=3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d&limit=20"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "notes": [
            {
                "id": "bb6fb81fee7298027e654deaa13a8a603fbee7a230ffdd320657b5040a9676ec",
                "content": "Maybe Nostr could be governed by Futarchy, or at least OpenSats.",
                "mentions": 0,
                "tag_count": 0,
                "created_at": 1780967976,
                "replies_to": 0
            },
            {
                "id": "d4c11312c688d2be284647e60719a277da10f873176e8a1ff59c911223136632",
                "content": "There should be a Nostr newsletter that only talked about the drama and fights happening here.",
                "mentions": 0,
                "tag_count": 0,
                "created_at": 1780963367,
                "replies_to": 0
            },
            {
                "id": "6a6fd11e2f37aa481507b7624aae7f6759885ee05537c84a45fc9672a53c97c0",
                "content": "https://www.youtube.com/watch?v=m6BQKFs3-VM",
                "mentions": 0,
                "tag_count": 0,
                "created_at": 1780954831,
                "replies_to": 0
            },
            {
                "id": "db28b3a9e451659fe117010920a4d3c56a611e4a77355c176be547c6a1c451aa",
                "content": "This is expected, just like programmers tend to write software for other programmers, people from cinema often make movies about the process of making movies or acting, writers write books about writing.\n\nBut in the case of Bitcoiners for some reas
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/profile` — Account profile metadata

**Parameters:**
- `pubkey` (query, required, string) — Public key: 64-hex or npub1… Example: `3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nostr-api/v1/profile?pubkey=3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
```

**Response:**
```json
{
    "data": {
        "name": "fiatjaf",
        "about": "~",
        "lud16": "npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6@npub.cash",
        "nip05": "_@fiatjaf.com",
        "banner": "https://cdn.satellite.earth/8f10244a702cbc2ca57b6c27a57b8cc02d5fdddccab0fc2e5988ce17e08f1732.jpg",
        "pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
        "picture": "https://fiatjaf.com/static/favicon.jpg",
        "website": "https://stuff.fiatjaf.com/",
        "updated_at": 1755901618,
        "display_name": null
    },
    "meta": {
        "timestamp": "2026-06-09T11:40:02.863Z",
        "request_id": "5461f06e-de54-44e1-b49f-9f1f73103be0"
    },
    "status": "ok",
    "message": "Profile retrieved successfully",
    "success": true
}
```

### Reference

#### `GET /v1/relays` — Relays queried

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nostr-api/v1/relays"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "relays": [
            "wss://relay.damus.io",
            "wss://nos.lol",
            "wss://relay.primal.net",
            "wss://relay.nostr.band",
            "wss://nostr.wine",
            "wss://relay.snort.social"
        ],
        "protocol": "Nostr NIP-01 over WebSocket"
    },
    "meta": {
        "timestamp": "2026-06-09T11:40:02.973Z",
        "request_id": "e47ba7d0-5b4c-4e40-ba6b-d8856c611937"
    },
    "status": "ok",
    "message": "Relays retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nostr-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "Public Nostr relays over WebSocket (NIP-01, live)",
        "service": "nostr-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/notes": "An account's recent text notes (pubkey=…, limit up to 50).",
            "GET /v1/relays": "The public relays queried.",
            "GET /v1/profile": "An account's profile metadata (pubkey=64-hex or npub1…)."
        },
        "description": "Live profile and notes for any Nostr account, read directly from the open Nostr relay network: kind-0 profile metadata (name, display name, about, picture, banner, website, NIP-05, Lightning address) and recent kind-1 text notes (content, timestamp, id, mention and reply counts), merged across several public relays and de-duplicated. Accepts 64-hex or npub1… keys. Live, no key, nothing stored. Distinct from centralised-platform social APIs — this reads the decentralised Nostr protocol straight from its relays.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-09T11:40:03.115Z",
        "request_id": "9dea45c9-dff8-4261-8ade-f4bd0463ef67"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/nostr-api
OpenAPI spec: https://www.oanor.com/api/nostr-api/openapi.json
