5e API5e.tools ↗
Access D&D 5e races, classes, subclasses, and spells from 5e.tools. Filter by name, source book, or class. Ideal for character builders and campaign tools.
What is the 5e API?
The 5e.tools API exposes four endpoints covering the core pillars of D&D 5th Edition character data: races, classes, and spells. The get_spells endpoint alone can return spells across all available source books — each spell object carrying level, school, components, duration, range, and full entries. The get_classes endpoint delivers complete class details including subclasses and class features when a specific class name is provided.
curl -X GET 'https://api.parse.bot/scraper/8452e5a0-87b8-461e-9cfd-d9ac9fa336b4/get_races?query=elf' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace 5e-tools-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: D&D 5e Tools SDK — search races, list classes, search spells."""
from parse_apis.d_d_5e_tools_api import DndTools, ClassName, ClassNotFound
client = DndTools()
# Search for elf races — limit caps total items returned
for race in client.races.search(query="elf", limit=3):
print(race.name, race.source, race.speed)
# List class data for a specific class using the ClassName enum
wizard = client.characterclasses.list(class_name=ClassName.WIZARD, limit=1).first()
if wizard:
print(wizard.name, wizard.source, wizard.edition)
# Search spells by name and source book
for spell in client.spells.search(query="fireball", source="PHB", limit=3):
print(spell.name, spell.level, spell.school)
# Discover available spell source codes
source_index = client.spells.sources()
print(source_index.sources)
# Typed error handling: catch ClassNotFound for an invalid class name
try:
result = client.characterclasses.list(class_name=ClassName.BARD, limit=1).first()
print(result.name if result else "no classes")
except ClassNotFound as exc:
print(f"Class not found: {exc.class_name}")
print("exercised: races.search / characterclasses.list / spells.search / spells.sources")
Retrieve D&D 5e species and races from the 5e.tools data. Filterable by a case-insensitive keyword matching race name. Returns all races when no query is provided. Each race includes name, source book, size, speed, darkvision range, trait tags, and detailed entry text.
| Param | Type | Description |
|---|---|---|
| query | string | Case-insensitive search keyword to filter races by name (e.g. 'elf', 'dwarf', 'halfling'). |
{
"type": "object",
"fields": {
"races": "array of race objects each containing name, source, size, speed, darkvision, traitTags, and entries"
},
"sample": {
"data": {
"races": [
{
"name": "Elf",
"size": [
"M"
],
"speed": 30,
"source": "PHB",
"entries": [
{
"name": "Age",
"type": "entries",
"entries": [
"..."
]
}
],
"traitTags": [
"Improved Resting"
],
"darkvision": 60
}
]
},
"status": "success"
}
}About the 5e API
Races and Species
The get_races endpoint returns all D&D 5e races and species available in 5e.tools data. Each race object includes name, source, size, speed, traits, and additional attributes. You can pass an optional query parameter — for example 'elf' or 'dwarf' — to filter by name in a case-insensitive match. No authentication or session is needed.
Classes and Subclasses
get_classes operates in two modes. Without class_name, it returns a summary list of all classes alongside an available_classes array of name strings — useful for populating a picker UI. When class_name is provided (e.g. 'wizard' or 'rogue'), the response expands to include the full class object: subclasses, class features at each level, and subclass features. This makes the endpoint suitable for building full class-progression displays.
Spells and Source Books
get_spells defaults to PHB spells when no parameters are given. You can narrow results with the query parameter (e.g. 'fireball') or switch source books using the source parameter. Use get_spell_sources first — it returns a sources object mapping source codes like 'PHB' or 'XGE' to their backing JSON filenames, so you know exactly which codes are valid. Set fetch_all to true to pull spells across every available source in a single call; note this can return a large result set. Each spell response includes a count field alongside the spells array and an available_sources list.
The 5e API is a managed, monitored endpoint for 5e.tools — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when 5e.tools changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official 5e.tools API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Character builder that populates race selection dropdowns with size, speed, and trait data from
get_races - Class progression viewer that renders level-by-level features and subclass options using
get_classeswith a specificclass_name - Spell reference tool filtered by source book code via the
sourceparameter onget_spells - Campaign preparation app that searches spells by keyword using the
queryparam and displays school, components, and range - Sourcebook coverage tracker that enumerates all available spell sources with
get_spell_sources - Homebrew tool that cross-references official race traits from
get_racesto scaffold custom species - Encounter planner that pulls full class feature sets to model NPC or player character abilities
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does 5e.tools have an official developer API?+
What does `get_classes` return differently when `class_name` is provided versus omitted?+
class_name, the response contains a classes summary array and an available_classes list of name strings — enough to populate a selector. When class_name is provided (e.g. 'fighter'), the response expands to include the full class object: subclasses, class features per level, and subclass features. The two modes serve different UI needs, so it is worth calling the summary form first to retrieve exact class name strings before requesting full detail.Can I retrieve spells from multiple specific source books in one call without fetching all sources?+
get_spells endpoint accepts a single source code per call. To combine spells from, say, PHB and XGE, you would make two separate requests and merge the results client-side. Setting fetch_all to true pulls every available source at once if you need broad coverage. You can fork this API on Parse and revise it to add a multi-source parameter if targeted batch fetching is important for your use case.Does the API cover monsters, magic items, or other 5e content beyond races, classes, and spells?+
get_races), classes and subclasses (via get_classes), and spells (via get_spells and get_spell_sources). Monsters, magic items, backgrounds, feats, and equipment are not exposed by the current endpoints. You can fork this API on Parse and revise it to add endpoints for those data categories.How fresh is the data returned by these endpoints?+
available_sources field in the get_spells response and the sources object from get_spell_sources are the reliable way to confirm which sourcebooks are currently indexed.