Houses, students and spells from a fictional wizarding school. Practice CRUD, Bearer auth, nested filtering by house, pagination and optimistic concurrency.
The Harry Potter API models a magic school: four houses with point totals, students sorted into them, and a spell book. Points move between houses, which makes it a natural fit for practising the read-modify-write cycle — and for seeing what happens when two clients try it at the same time.
Base URL: https://funapi.dev/api/wizarding/v1 · 10 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
GET https://funapi.dev/api/wizarding/v1/houses — List all houses. No token, no signup:
curl -i https://funapi.dev/api/wizarding/v1/houses
answers 200 OK with:
{
"total": 4,
"data": [
{
"id": 1,
"name": "Gryffindor",
"founder": "Godric Gryffindor",
"traits": [
"courage",
"bravery",
"daring"
],
"element": "fire",
"points": 472
},
{
"id": 2,
"name": "Slytherin",
"founder": "Salazar Slytherin",
"traits": [
"ambition",
"cunning",
"resourcefulness"
],
"element": "water",
"points": 452
},
{
"id": 3,
"name": "Hufflepuff",
"founder": "Helga Hufflepuff",
"traits": [
"patience",
"loyalty",
"fairness"
],
"element": "earth",
"points": 428
},
{
"id": 4,
"name": "Ravenclaw",
"founder": "Rowena Ravenclaw",
"traits": [
"wisdom",
"wit",
"creativity"
],
"element": "air",
"points": 461
}
]
}
four houses, four elements
GET /wizarding/v1/houses — List all houses · Responds with 200 Link to this endpointGET /wizarding/v1/houses/{id} — Get one house · Responds with 200 404 Link to this endpointPOST /wizarding/v1/sorting-hat — The Sorting Hat assigns you a house (stateless, random) · Responds with 200 Link to this endpointsorted, patronus and all
GET /wizarding/v1/students — List students (paginated, filter by house) · Responds with 200 400 404 Link to this endpointGET /wizarding/v1/students/{id} — Get one student · Responds with 200 404 Link to this endpointPOST /wizarding/v1/students — Enroll a student (requires Bearer auth) · Responds with 201 400 401 Link to this endpointPUT /wizarding/v1/students/{id} — Update a student (requires Bearer auth) · Responds with 200 400 401 404 412 Link to this endpointDELETE /wizarding/v1/students/{id} — Expel a student (requires Bearer auth) · Responds with 204 401 403 404 412 Link to this endpointcharms, jinxes, and one unforgivable
GET /wizarding/v1/spells — List spells, filter by type · Responds with 200 Link to this endpointGET /wizarding/v1/spells/random — A random spell · Responds with 200 Link to this endpointUnofficial and fan-made. The Harry Potter API is a practice API that borrows a theme; it is not affiliated with, sponsored or endorsed by the owners of the names it references, which belong to them. Every record it returns is test data for exercising HTTP behaviour, not an authoritative source on the subject.
Last updated