5e API5e.tools ↗
Access D&D 5e game data via API: races, classes, spells, feats, optional features, and spell-to-class mappings sourced from 5e.tools.
What is the 5e API?
The 5e.tools API exposes 7 endpoints covering core D&D 5th Edition game data — races, classes, spells, feats, optional features, and spell-to-class cross-references. The get_spells_by_class endpoint, for example, returns each spell with its associated class list and spell level, including separate records for the 2014 PHB and 2024 XPHB printings, making it straightforward to power spell list lookups that are edition-aware.
curl -X GET 'https://api.parse.bot/scraper/8452e5a0-87b8-461e-9cfd-d9ac9fa336b4/get_races?query=elf' \ -H 'X-API-Key: $PARSE_API_KEY'
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
Race, Class, and Feat Data
The get_races endpoint returns race objects with fields including name, source, size, speed, darkvision, traitTags, and full entries text. An optional query parameter does case-insensitive name filtering — pass 'elf' to narrow results to elf variants. The get_classes endpoint works in two modes: omit class_name to get a summary list of all classes plus an available_classes index; supply a class name to get the complete record including subclasses, class features, and subclass features. get_feats returns roughly 300 feat records across all source books, with fields like category, prerequisite, ability, and entries. Both the 2014 and 2024 printings of the same feat appear as separate records under different source values.
Spell Endpoints
get_spells defaults to PHB spells when neither source nor fetch_all is specified. Use the source parameter with a book code (discoverable via get_spell_sources) to target a specific sourcebook. Set fetch_all to true to pull spells across all available sources in one call — expect a large result set. Each spell object carries level, school, time, range, components, duration, and entries. The get_spell_sources endpoint returns a mapping of source codes (e.g. PHB, XPHB) to their underlying filenames, giving you a complete list of valid source values.
Spell-to-Class Cross-Reference and Optional Features
get_spells_by_class extends spell data with a classes array on each record, showing which classes can cast that spell and at what level (0 = cantrip). You can filter by class_name, source, or spell query independently or in combination. Because each printing is a separate record, wizard spells from PHB and XPHB appear distinctly. The get_optional_features endpoint covers eldritch invocations, metamagic options, fighting styles, maneuvers, artificer infusions, rune knight runes, and similar class-option lists. Filter by feature_type (matched against the featureType array on each record) or use query for name search. The response always includes available_feature_types — all type codes present in the full dataset, unaffected by any active filters.
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?+
- Build a character creation tool that populates race options with darkvision range and trait tags from
get_races. - Generate printable spell lists per class using
get_spells_by_classfiltered byclass_name. - Display complete class progression pages including subclass features using
get_classeswith a specificclass_name. - Show feat prerequisites and ability score changes in a feat browser backed by
get_feats. - Implement a warlock invocation picker using
get_optional_featuresfiltered to theEIfeature type. - Sync spell databases across edition-year by distinguishing PHB vs. XPHB records from
get_spells_by_class. - Populate a sourcebook selector dropdown from
get_spell_sourcesbefore letting users query spells by source.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does 5e.tools have an official developer API?+
How does `get_spells_by_class` differ from `get_spells`?+
get_spells returns mechanical spell details — level, school, range, components, duration, and entry text — without class associations. get_spells_by_class adds a classes array to each spell record, listing every class that can cast it and the slot level required. Both endpoints support the same query, source, and fetch_all filters; get_spells_by_class also accepts a class_name filter.Why do some feats and spells appear more than once in results?+
source field. Filtering by source lets you restrict results to a single printing.Does the API return monster stat blocks or magic items?+
Are there pagination controls for large result sets?+
fetch_all: true on spell endpoints or unfiltered calls to get_feats can return several hundred records at once. Use the query or source filters to reduce result size when needed.