Original heroes and villains with powers, teams and nemeses. Practice nested resources (/heroes/{id}/nemesis), filtering and role-based auth.
The Superhero API is the smallest resource tree in the catalog and the clearest one for practising nested routes: heroes own powers, and powers are addressed underneath their hero rather than in a flat collection. If you are writing a client that has to build URLs from parent ids, or tests that must clean up children before parents, this is the shape to rehearse on.
Base URL: https://funapi.dev/api/superheroes/v1 · 6 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
GET https://funapi.dev/api/superheroes/v1/heroes — List heroes (paginated, filterable). No token, no signup:
curl -i https://funapi.dev/api/superheroes/v1/heroes
answers 200 OK with:
{
"page": 1,
"pageSize": 4,
"total": 8,
"totalPages": 2,
"data": [
{
"id": 1,
"name": "Captain Volt",
"alias": "Deniz Aksoy",
"power": "electricity",
"team": "Alpha Squad",
"nemesisId": 5,
"_v": 1
},
{
"id": 2,
"name": "Night Owl",
"alias": "Sam Reyes",
"power": "night vision",
"team": "Alpha Squad",
"nemesisId": 6,
"_v": 1
},
{
"id": 3,
"name": "Aqua Comet",
"alias": "Mira Chen",
"power": "hydrokinesis",
"team": "Freelance",
"nemesisId": null,
"_v": 1
},
{
"id": 4,
"name": "Turbo Tortoise",
"alias": "unknown",
"power": "super speed (eventually)",
"team": "Freelance",
"nemesisId": 7,
"_v": 1
}
]
}
capes, powers and their sworn enemies
GET /superheroes/v1/heroes — List heroes (paginated, filterable) · Responds with 200 400 404 Link to this endpointGET /superheroes/v1/heroes/{id} — Get one hero · Responds with 200 404 Link to this endpointGET /superheroes/v1/heroes/{id}/nemesis — Get a hero's nemesis (nested resource) · Responds with 200 404 Link to this endpointPOST /superheroes/v1/heroes — Register a new hero (requires Bearer auth) · Responds with 201 400 401 Link to this endpointDELETE /superheroes/v1/heroes/{id} — Retire a hero (requires Bearer auth) · Responds with 204 401 403 404 412 Link to this endpointPOST /superheroes/v1/heroes/versus — Simulate a fight between two heroes (requires Bearer auth) · Responds with 201 400 401 Link to this endpointLast updated