Introduction

A free, open REST API for the Wizarding World — no key, no signup, no rate limit.

The Hogwarts API serves data from the wizarding world of Harry Potter, Fantastic Beasts and Hogwarts Legacy as plain JSON over HTTP. It exists so you have something richer than lorem ipsum and foo@bar.com when you are building, teaching or demoing something.

Every endpoint is a GET. There is no authentication, no API key and no rate limit.

Base URL

https://hogwarts-api.com/api

What is in it

CollectionRecordsEndpoint
Books7/api/books
Movies11/api/movies
Characters5,410/api/characters
Spells345/api/spells
Potions168/api/potions
Creatures143/api/creatures

GET /api returns this same directory as JSON, so you can discover the collections programmatically.

Response shape

Every response is wrapped in a data key. List endpoints add a meta object describing the current page.

List response
Single response
{
  "data": [
    { "id": "harry-potter", "slug": "harry-potter", "name": "Harry James Potter" }
  ],
  "meta": {
    "page": 1,
    "page_size": 25,
    "total_pages": 217,
    "total_records": 5410,
    "search": null
  }
}

Response headers

Every /api response carries three headers. They do nothing useful.

HeaderValue
X-Sorting-HatOne of Gryffindor, Hufflepuff, Ravenclaw or Slytherin — re-sorted every request
X-Wizard-StatusCertified Wizard
X-Deployment-LocationThe Room of Requirement
curl -i https://hogwarts-api.com/api/books | grep -i '^x-'

Missing data is null, not absent

The source material is uneven: most characters have a name, far fewer have a patronus. Rather than omitting a field, the API returns null for it. Every record in a collection therefore has the same keys, and you can rely on the shape.

Attribution

Data is compiled from Potter DB and the Harry Potter Fandom wiki, which is licensed CC-BY-SA. Every record carries a wiki field linking back to its source article.

Harry Potter and Fantastic Beasts are trademarks of Warner Bros. This is an unofficial fan project with no affiliation to Warner Bros. or J.K. Rowling.