# Game of Thrones API
> The world of A Song of Ice and Fire — the books behind Game of Thrones — as an API. Look up any character (e.g. Jon Snow → culture Northmen, titles, aliases like "Lord Snow", and his house allegiances), the great and minor houses (e.g. House Targaryen → region The Crownlands, words "Fire and Blood", seats and 100+ sworn members), and the novels (e.g. A Game of Thrones → 694 pages, 434 characters, ISBN, publisher and release date). Search and filter characters by name, culture and gender, houses by name, region and words, and books by name, with paging — and follow the cross-references (parents, spouse, allegiances, books) by id. Backed by the open anapioficeandfire.com dataset. Ideal for fan sites, trivia and quiz games, Discord bots and any Westeros app.

## 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/gameofthrones-api/..."
```

## Pricing
- **Free** (Free) — 9,500 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 135,000 calls/Mo, 8 req/s
- **Pro** ($10/Mo) — 660,000 calls/Mo, 20 req/s
- **Mega** ($32/Mo) — 2,750,000 calls/Mo, 50 req/s

## Endpoints

### Game of Thrones

#### `GET /v1/book` — A book by id or by name

**Parameters:**
- `id` (query, optional, string) — Book id, e.g. 1 (A Game of Thrones) Example: `1`
- `name` (query, optional, string) — Name search
- `page` (query, optional, string) — Page number Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gameofthrones-api/v1/book?id=1&page=1"
```

**Response:**
```json
{
    "data": {
        "book": {
            "id": 1,
            "isbn": "978-0553103540",
            "name": "A Game of Thrones",
            "authors": [
                "George R. R. Martin"
            ],
            "country": "United States",
            "released": "1996-08-01T00:00:00",
            "publisher": "Bantam Books",
            "media_type": "Hardcover",
            "character_count": 434,
            "number_of_pages": 694,
            "pov_character_count": 9
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:32.670Z",
        "request_id": "cffb783c-146f-4d34-b3cf-63505721eccd"
    },
    "status": "ok",
    "message": "Book retrieved",
    "success": true
}
```

#### `GET /v1/character` — A character by id or filtered search

**Parameters:**
- `id` (query, optional, string) — Character id, e.g. 583 (Jon Snow) Example: `583`
- `name` (query, optional, string) — Name search, e.g. Jon Snow
- `culture` (query, optional, string) — Culture, e.g. Northmen
- `gender` (query, optional, string) — Male | Female
- `page` (query, optional, string) — Page number (default 1) Example: `1`
- `pageSize` (query, optional, string) — Page size (1-50, default 10) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gameofthrones-api/v1/character?id=583&page=1&pageSize=10"
```

**Response:**
```json
{
    "data": {
        "character": {
            "id": 583,
            "born": "In 283 AC",
            "died": null,
            "name": "Jon Snow",
            "gender": "Male",
            "titles": [
                "Lord Commander of the Night's Watch"
            ],
            "aliases": [
                "Lord Snow",
                "Ned Stark's Bastard",
                "The Snow of Winterfell",
                "The Crow-Come-Over",
                "The 998th Lord Commander of the Night's Watch",
                "The Bastard of Winterfell",
                "The Black Bastard of the Wall",
                "Lord Crow"
            ],
            "culture": "Northmen",
            "book_ids": [
                5
            ],
            "father_id": null,
            "mother_id": null,
            "played_by": [
                "Kit Harington"
            ],
            "spouse_id": null,
            "tv_series": [
                "Season 1",
                "Season 2",
                "Season 3",
                "Season 4",
                "Season 5",
                "Season 6"
            ],
            "allegiance_house_ids": [
                362
            ]
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:32.772Z",
        "request_id": "97a29067-59f2-4b11-938b-987cc53a05a4"
    },
    "status": "ok",
    "message": "Character retrieved",
    "success": true
}
```

#### `GET /v1/house` — A house by id or filtered search

**Parameters:**
- `id` (query, optional, string) — House id, e.g. 378 (House Targaryen) Example: `378`
- `name` (query, optional, string) — Name search
- `region` (query, optional, string) — Region, e.g. The North
- `words` (query, optional, string) — House words search
- `page` (query, optional, string) — Page number Example: `1`
- `pageSize` (query, optional, string) — Page size (1-50, default 10) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gameofthrones-api/v1/house?id=378&page=1&pageSize=10"
```

**Response:**
```json
{
    "data": {
        "house": {
            "id": 378,
            "name": "House Targaryen of King's Landing",
            "seats": [
                "Red Keep (formerly)",
                "Summerhall (formerly)"
            ],
            "words": "Fire and Blood",
            "region": "The Crownlands",
            "titles": [
                "King of the Andals, the Rhoynar and the First Men",
                "Lord of the Seven Kingdoms",
                "Prince of Summerhall"
            ],
            "founded": "House Targaryen: >114 BCHouse Targaryen of King's Landing:1 AC",
            "died_out": null,
            "founder_id": null,
            "overlord_id": null,
            "coat_of_arms": "Sable, a dragon thrice-headed gules",
            "current_lord_id": 1303,
            "cadet_branch_ids": [
                23
            ],
            "ancestral_weapons": [
                "Blackfyre",
                "Dark Sister"
            ],
            "sworn_member_count": 101
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:32.839Z",
        "request_id": "e3ee942a-aa30-48b6-b2d8-7a97b595ea60"
    },
    "status": "ok",
    "message": "House retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Filters & usage notes

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

**Response:**
```json
{
    "data": {
        "note": "The world of A Song of Ice and Fire (Game of Thrones). /v1/character = a character by id or search (name, culture, gender; e.g. id=583 → Jon Snow); /v1/house = a house by id or filter (name, region, words; e.g. id=378 → House Targaryen); /v1/book = a book by id or by name. Add page & pageSize to paginate. Relations (father, allegiances, books, …) are returned as ids.",
        "source": "An API of Ice and Fire (anapioficeandfire.com)",
        "filters": {
            "book": [
                "name"
            ],
            "house": [
                "name",
                "region",
                "words"
            ],
            "character": [
                "name",
                "culture",
                "gender"
            ]
        },
        "endpoints": [
            "/v1/character",
            "/v1/house",
            "/v1/book",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:32.908Z",
        "request_id": "96576157-2aa8-4b34-b820-c63ee3462f17"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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