An API of Ice And Fire
Free A Song of Ice and Fire API with no key: 400+ houses, 2,000+ characters and every book, cross-linked by URL with proper HTTP pagination. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the An API of Ice And Fire?
An API of Ice And Fire is a free, key-free REST API covering George R. R. Martin's A Song of Ice and Fire. It serves over 2,000 characters, more than 400 houses and every published book, with records cross-linked by URL and pagination delivered through standard HTTP Link headers.
This API is deliberately book-based rather than show-based, which matters if accuracy to the source material is the point of your project. It is also notably well-engineered for a fan project: resources reference each other by absolute URL rather than by bare id, so you can traverse from a house to its overlord to its founder by following links, exactly as a hypermedia API is meant to work.
Pagination is the other thing it gets right, and it is a genuinely useful thing to learn against. Rather than putting page metadata in the body, it uses the standard HTTP `Link` header with `rel="next"`, `"prev"`, `"first"` and `"last"` — the same mechanism GitHub's API uses. That means the response body stays a clean array, and your client reads pagination from headers, which is a pattern worth practising on a low-stakes dataset.
Quick facts
- Base URL
https://anapioficeandfire.com/api- Authentication
- No API key or account. Open source and free for any use.
- Rate limit
- No published limit. The dataset is static, so cache aggressively.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the An API of Ice And Fire
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Fetch one house from Westeros
GET https://anapioficeandfire.com/api/houses?pageSize=1
curl 'https://anapioficeandfire.com/api/houses?pageSize=1'const res = await fetch("https://anapioficeandfire.com/api/houses?pageSize=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://anapioficeandfire.com/api/houses?pageSize=1", timeout=20)
res.raise_for_status()
print(res.json())[
{
"url": "https://anapioficeandfire.com/api/houses/1",
"name": "House Algood",
"region": "The Westerlands",
"coatOfArms": "A golden wreath, on a blue field with a gold border(Azure, a garland of laurel within a bordure or)",
"words": "",
"titles": [],
"seats": [],
"currentLord": "",
"heir": "",
"overlord": "https://anapioficeandfire.com/api/houses/229",
"founded": "",
"founder": "",
"diedOut": "",
"ancestralWeapons": [],
"cadetBranches": [],
"swornMembers": []
}
]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
resource | path segment | Required | `books`, `characters` or `houses`. houses |
page | query | Optional | Page number. Read the `Link` response header rather than incrementing blindly. 1 |
pageSize | query | Optional | Records per page, up to 50. 1 |
name | query | Optional | Filter by exact name. House Algood |
region | query | Optional | On houses, filter by region such as `The Westerlands`. The North |
hasWords / hasTitles | query | Optional | Boolean filters for houses that have words or titles recorded. true |
Response fields
urlstring- The resource's own canonical URL — this is its identifier. There is no separate numeric id field.
namestring- House, character or book name.
regionstring- Which region of Westeros the house belongs to.
coatOfArmsstring- Heraldic description, often with the formal blazon in parentheses.
wordsstring- House words or motto. Empty string when not recorded in the books.
overlord / founder / heirstring- URLs to related records — follow them to expand. Empty string when unknown.
titles / seats / swornMembersarray- Related values and URLs. Frequently empty arrays for minor houses.
Link (header)header- Standard HTTP pagination with `rel="next"`, `"prev"`, `"first"` and `"last"` — the pagination lives here, not in the body.
What you can build with the An API of Ice And Fire
- Build a Westeros house or character browser
- Practise hypermedia navigation by following resource URLs
- Learn HTTP Link-header pagination against a safe dataset
- Add a lore lookup to a fan site or Discord bot
Common errors and how to fix them
404
Unknown resource path or id.
Fix: Resource names are plural: `/houses`, `/characters`, `/books`.
Empty strings everywhere
Not an error — minor houses have very little recorded.
Fix: Empty string is the convention for unknown, not null. Check for both before rendering.
Pagination seems missing
It is in the `Link` response header, not the body.
Fix: Parse the `Link` header for `rel="next"`. The body is deliberately a clean array with no metadata wrapper.
An API of Ice And Fire — frequently asked questions
Is the Game of Thrones API free?
Yes, free with no API key or account. It is open source and covers the books rather than the television series.
Is it based on the books or the TV show?
The books — A Song of Ice and Fire. That is a deliberate choice, and it matters if your project needs to be accurate to the source material rather than the adaptation.
How does pagination work?
Through the standard HTTP `Link` response header, with `rel="next"`, `"prev"`, `"first"` and `"last"` — the same mechanism GitHub's API uses. The response body stays a clean array with no metadata wrapper, so read pagination from the headers.
Why are so many fields empty?
Because the books record very little about minor houses. The API uses empty strings rather than null for unknown values, so guard for both when rendering.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Path Finder
Evaluate a dot/bracket path against your JSON and list every leaf path for discovery. Free online JSON path finder that runs 100% in your browser.
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
An API of Ice And Fire is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.