An API of Ice And Fire API

Beginner's Pick Video / No Auth Required Beginner HTTPS
Free to Use
89 A
Measured Score 0 50 100 Speed 29/30 Consistency 17/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

Overview

An API of Ice and Fire is a free, open REST API providing comprehensive data from the Game of Thrones universe, including characters, houses, and books from George R.R. Martin's series. No authentication is needed — you can start making requests immediately. It is an excellent beginner API for learning how to work with paginated REST endpoints.

Beginner Tip

Results are paginated by default (20 items per page) — use the ?page=2&pageSize=50 query parameters to navigate through results. The response also includes Link headers with next/previous page URLs, which is great practice for learning pagination patterns.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://anapioficeandfire.com/api/characters/583
Result
HTTP 200 · application/json · 853 bytes · compressed
Response time
32 ms (median of 3) · fastest 28 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
cloudflare
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
url string (url) https://anapioficeandfire.com/api/characters/583
name string Jon Snow
gender string Male
culture string Northmen
born string In 283 AC
died string
titles array [1 item]
aliases array [1 item]
father string
mother string
spouse string
allegiances array [1 item]
books array [1 item]
povBooks array [1 item]

Captured Response

Captured from a real request to https://anapioficeandfire.com/api/characters/583 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "url": "https://anapioficeandfire.com/api/characters/583",
  "name": "Jon Snow",
  "gender": "Male",
  "culture": "Northmen",
  "born": "In 283 AC",
  "died": "",
  "titles": [
    "Lord Commander of the Night's Watch"
  ],
  "aliases": [
    "Lord Snow"
  ],
  "father": "",
  "mother": "",
  "spouse": "",
  "allegiances": [
    "https://anapioficeandfire.com/api/houses/362"
  ],
  "books": [
    "https://anapioficeandfire.com/api/books/5"
  ],
  "povBooks": [
    "https://anapioficeandfire.com/api/books/1"
  ],
  "…": "(2 more fields)"
}

Field Reference

url The canonical URL for this specific character, house, or book resource.
name The character's name — may be empty for unnamed characters, check aliases instead.
aliases List of alternate names or titles for the character (e.g., "The Imp", "Kingslayer").
allegiances List of URLs pointing to the houses this character has sworn allegiance to.
titles Official titles held by the character (e.g., "Lord of Winterfell").
born In-universe birth description (e.g., "In 262 AC, at Dragonstone").

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://anapioficeandfire.com/api/characters/583";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist unknown

Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

404 Not Found The character, house, or book ID does not exist.
Use the list endpoints (/api/characters, /api/houses, /api/books) to discover valid IDs before querying specific resources.
Empty name fields Many characters in the series are unnamed or go by aliases.
Check the "aliases" array when the "name" field is empty — most unnamed characters still have aliases listed.
Slow response for large collections The characters endpoint has thousands of records that can be slow without pagination.
Always use pageSize (max 50) and page parameters to fetch data in chunks rather than requesting large datasets at once.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 29/30
Consistency 17/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 32ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Video
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →