
Harry Potter API
MediaThe database of harry potter movies all characters, houses and spells. With a single /Get command you are able to fetch the characters, Hogwarts Houses and list of characters affiliated with the House. It also allows you to fetch all the spells performed in the Harry Potter season.
📚 Documentation & Examples
Everything you need to integrate with Harry Potter API
🚀 Quick Start Examples
// Harry Potter API API Example
const response = await fetch('https://www.potterapi.com/', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);Introduction to PotterAPI
PotterAPI is a RESTful API that allows developers to access and retrieve data on the Harry Potter universe. The API has a wide range of endpoints, which provides information on characters, houses, spells, and more. The API is free to use and requires no authentication.
Getting Started — No API Key Required (potterapi.com is gone)
The original PotterAPI at potterapi.com has shut down and the domain is now for sale, so its API keys and potterapi.com/v1/... endpoints no longer work. Use a current, free, key-free Harry Potter API instead.
HP-API (no signup, no key):
// All characters
const characters = await (await fetch('https://hp-api.onrender.com/api/characters')).json();
// Filter to a house
const gryffindor = await (await fetch(
'https://hp-api.onrender.com/api/characters/house/gryffindor'
)).json();
It exposes /api/characters, /api/characters/students, /api/characters/staff, /api/spells, and house filters — all JSON, no authentication.
PotterDB is another actively maintained, key-free option with a richer dataset (books, movies, characters, spells, potions) at https://api.potterdb.com/v1/...:
const spells = await (await fetch('https://api.potterdb.com/v1/spells')).json();
Both are free and require no API key or account, so you can start immediately. If an old tutorial tells you to register at potterapi.com for a key, ignore it — that service is defunct.
Examples
Characters
To get information on a specific character, you can make a request to the /characters endpoint, followed by the character's name.
var characterName = "Harry Potter";
var apiUrl = "https://www.potterapi.com/v1/characters?key=[YOUR_API_KEY]&name=" + characterName;
fetch(apiUrl)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Houses
To get information on a specific house, you can make a request to the /houses endpoint, followed by the house's name.
var houseName = "Gryffindor";
var apiUrl = "https://www.potterapi.com/v1/houses?key=[YOUR_API_KEY]&name=" + houseName;
fetch(apiUrl)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Spells
To get information on a specific spell, you can make a request to the /spells endpoint, followed by the spell's name.
var spellName = "Lumos";
var apiUrl = "https://www.potterapi.com/v1/spells?key=[YOUR_API_KEY]&spell=" + spellName;
fetch(apiUrl)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Conclusion
PotterAPI is an excellent resource for any Harry Potter fan or developer looking to build an application related to the Harry Potter universe. It provides a vast range of endpoints, which makes it a valuable tool for building exciting applications. Following the above examples, you can get started with using the PotterAPI and start to build some excellent applications.









