The Spells API provides access to the Jarvis Harry Potter spell
database, including spell information, spell types, spell casting
examples and random spell generation.
Base Endpoint
/api/spells/[action]/[object]
| Part |
Description |
action |
The operation to perform. |
object |
Optional value used by the selected action. |
Available Endpoints
| Endpoint |
Description |
/api/spells |
List spells. |
/api/spells/random |
Returns a random spell. |
/api/spells/id/{id} |
Lookup a spell by internal ID. |
/api/spells/name/{name} |
Lookup a spell by name. |
/api/spells/search/{query} |
Search spell names, descriptions and notes. |
/api/spells/type/{type} |
List spells by type. |
/api/spells/types |
List available spell types. |
/api/spells/cast |
Cast a random spell and return a sentence. |
/api/spells/cast/{name} |
Cast a specific spell. |
/api/spells/sentence/{id} |
Get example sentences for a spell. |
/api/spells/random-sentence |
Return a random spell sentence. |
/api/spells/count |
Spell database statistics. |
Query Parameters
| Parameter |
Example |
Description |
limit |
25 |
Maximum results returned. |
type |
Charm |
Filter spells by spell type. |
active |
true |
Return only active spells. |
nsfw |
true |
Include NSFW spell sentences. |
Spell Lookup Examples
GET /api/spells/id/1
GET /api/spells/name/Accio
GET /api/spells/name/Expelliarmus
GET /api/spells/name/Lumos
Spell Search Examples
GET /api/spells/search/patronus
GET /api/spells/search/fire
GET /api/spells/search/healing
Spell Type Examples
GET /api/spells/type/Charm
GET /api/spells/type/Curse
GET /api/spells/type/Jinx
GET /api/spells/type/Hex
GET /api/spells/types
Random Spell Examples
GET /api/spells/random
GET /api/spells/random?type=Charm
GET /api/spells/random?type=Curse
Casting Spells
The cast endpoint combines spell information with a randomly selected
example sentence from the sentence database.
GET /api/spells/cast
GET /api/spells/cast/Accio
GET /api/spells/cast/Expelliarmus
GET /api/spells/cast/Lumos
Example Response:
{
"id": 1,
"name": "Accio",
"type": "Charm",
"description": "Summons an object.",
"sentence": "Accio biscuits! The snacks flew across the room."
}
Spell Sentence Examples
GET /api/spells/sentence/1
GET /api/spells/sentence/1?nsfw=true
Example Response:
[
{
"id": 42,
"spell_book_id": 1,
"sentence": "Accio keys! The keys shot into Harry's hand.",
"nsfw": false
}
]
Random Sentence Examples
GET /api/spells/random-sentence
GET /api/spells/random-sentence?nsfw=true
Example Response:
{
"id": 78,
"spell_book_id": 5,
"name": "Expelliarmus",
"type": "Charm",
"sentence": "The wand flew from the wizard's hand.",
"nsfw": false
}
Example Spell Response
{
"id": 1,
"name": "Accio",
"type": "Charm",
"pronunciation": "AK-ee-oh",
"description": "Summons an object.",
"etymology": "Derived from Latin meaning 'I summon'.",
"notes": "Frequently used by Harry Potter.",
"active": true,
"created_at": "2026-11-04T00:00:00+00:00",
"updated_at": "2026-11-04T00:00:00+00:00"
}
Example Types Response
[
{
"type": "Charm",
"spell_count": 84
},
{
"type": "Curse",
"spell_count": 23
},
{
"type": "Jinx",
"spell_count": 41
},
{
"type": "Hex",
"spell_count": 17
}
]
Example Statistics Response
{
"spells": 187,
"active_spells": 184,
"spell_types": 12,
"sentences": 542,
"sfw_sentences": 498,
"nsfw_sentences": 44
}
Common Use Cases
| Use Case |
Endpoint |
| Random Harry Potter spell command |
/api/spells/random |
| Cast a spell command |
/api/spells/cast |
| Lookup spell information |
/api/spells/name/{spell} |
| Spell encyclopedia |
/api/spells |
| Spell quote generator |
/api/spells/random-sentence |
| Harry Potter trivia games |
/api/spells/types |