Harry Potter API

Entertainment API · Harry Potter universe · Characters & spells · No auth

TL;DR

The Harry Potter API provides structured data from the Wizarding World — characters, spells, houses, potions, and books. Each character entry includes house, patronus, wand (wood, core, length), blood status, ancestry, and actor name. Spells include incantation, type, and effect. Data is drawn from the books and films.

Quick start: https://hp-api.onrender.com/api/characters

No API key needed — just make a request!

How to Use This API

1. All Characters

https://hp-api.onrender.com/api/characters

Returns all characters with full details (over 400 entries including minor characters).

2. Characters by House

https://hp-api.onrender.com/api/characters/house/gryffindor

Filter by Hogwarts house: gryffindor, slytherin, ravenclaw, hufflepuff.

3. Characters with Patronus

https://hp-api.onrender.com/api/characters?patronus=stag

Query parameters available: patronus, bloodStatus, ancestry, house.

4. All Spells

https://hp-api.onrender.com/api/spells

Returns every known spell with incantation, name, description, and type (Charm, Hex, Jinx, Curse, Transfiguration).

5. JavaScript — House Explorer

async function getHouseCharacters(house) {
  const resp = await fetch(
    `https://hp-api.onrender.com/api/characters/house/${house}`
  );
  const characters = await resp.json();
  
  const wandTypes = {};
  characters.forEach(c => {
    if (c.wand?.wood) {
      wandTypes[c.wand.wood] = (wandTypes[c.wand.wood] || 0) + 1;
    }
  });
  
  console.log(`${house} — ${characters.length} characters`);
  console.log('Most common wand woods:');
  Object.entries(wandTypes)
    .sort((a, b) => b[1] - a[1])
    .slice(0, 5)
    .forEach(([wood, count]) => {
      console.log(`  ${wood}: ${count}`);
    });
}

getHouseCharacters('gryffindor');
6. Python — Spell Finder
import requests

def find_spells_by_type(spell_type='Charm'):
    resp = requests.get('https://hp-api.onrender.com/api/spells')
    spells = resp.json()
    
    filtered = [s for s in spells if s.get('type') == spell_type]
    print(f"{spell_type}s ({len(filtered)} total):")
    for s in filtered[:10]:
        print(f"  {s['name']} — \"{s['incantation']}\"")
        print(f"    {s.get('description', '')}")

find_spells_by_type('Curse')
Try Gryffindor house: https://hp-api.onrender.com/api/characters/house/gryffindor

Frequently Asked Questions

What character data is included?
Name, house, patronus, wand (wood, core, length), species, blood status, ancestry, eye colour, hair colour, date of birth, actor, image URL (when available).
What spells are covered?
All spells from the books and films including the incantation, name, type (Charm, Hex, Jinx, Curse, Transfiguration, Healing, Counter-Spell), and description of effect.
Are movie-specific characters included?
Yes, characters from both books and films are included. The actor field links characters to their film portrayals.
Is there a house endpoint besides characters?
The API has a houses endpoint at /api/houses with details about each Hogwarts house (founder, colors, animal, element, ghost, traits, common room).
What about potions?
Potions data is available at /api/potions with ingredients, effect, difficulty, and brewing instructions.

API Details

API URL
https://hp-api.onrender.com/api
Documentation
hp-api.onrender.com
Category
Entertainment
Authentication
Not Required
Geographic Coverage
Global — Wizarding World

What You Can Build