# D&D 5e API API

> # Introduction Welcome to the dnd5eapi, the Dungeons & Dragons 5th Edition API! This documentation should help you familiarize yourself with the resources available and how to consume them with HTTP requests. Read through the getting started section before you dive in. Most of your problems should be solved just by reading through it. ## Getting Started Let's make our first API request to the D&D 5th Edition API! Open up a terminal and use [curl](http://curl.haxx.se/) or [httpie](http://httpie.org/) to make an API request for a resource. You can also scroll through the definitions below and send requests directly from the endpoint documentation! For example, if you paste and run this `curl` command: ```bash curl -X GET "https://www.dnd5eapi.co/api/ability-scores/cha" -H "Accept: application/json" ``` We should see a result containing details about the Charisma ability score: ```bash { "index": "cha", "name": "CHA", "full_name": "Charisma", "desc": [ "Charisma measures your ability to interact effectively with others. It includes such factors as confidence and eloquence, and it can represent a charming or commanding personality.", "A Charisma check might arise when you try to influence or entertain others, when you try to make an impression or tell a convincing lie, or when you are navigating a tricky social situation. The Deception, Intimidation, Performance, and Persuasion skills reflect aptitude in certain kinds of Charisma checks." ], "skills": [ { "name": "Deception", "index": "deception", "url": "/api/skills/deception" }, { "name": "Intimidation", "index": "intimidation", "url": "/api/skills/intimidation" }, { "name": "Performance", "index": "performance", "url": "/api/skills/performance" }, { "name": "Persuasion", "index": "persuasion", "url": "/api/skills/persuasion" } ], "url": "/api/ability-scores/cha" } ``` ## Authentication The dnd5eapi is a completely open API. No authentication is required to query and get data. This also means that we've limited what you can do to just `GET`-ing the data. If you find a mistake in the data, feel free to [message us](https://discord.gg/TQuYTv7). ## GraphQL This API supports [GraphQL](https://graphql.org/). The GraphQL URL for this API is `https://www.dnd5eapi.co/graphql`. Most of your questions regarding the GraphQL schema can be answered by querying the endpoint with the Apollo sandbox explorer. ## Schemas Definitions of all schemas will be accessible in a future update. Two of the most common schemas are described here. ### `APIReference` Represents a minimal representation of a resource. The detailed representation of the referenced resource can be retrieved by making a request to the referenced `URL`. ``` APIReference { index string name string url string } ``` <hr> ### `DC` Represents a difficulty check. ``` DC { dc_type APIReference dc_value number success_type "none" | "half" | "other" } ``` <hr> ### `Damage` Represents damage. ``` Damage { damage_type APIReference damage_dice string } ``` <hr> ### `Choice` Represents a choice made by a player. Commonly seen related to decisions made during character creation or combat (e.g.: the description of the cleric class, under **Proficiencies**, states "Skills: Choose two from History, Insight, Medicine, Persuasion, and Religion" [[SRD p15]](https://media.wizards.com/2016/downloads/DND/SRD-OGL_V5.1.pdf#page=15)) ``` Choice { desc string choose number type string from OptionSet } ``` <hr> ### `OptionSet` The OptionSet structure provides the options to be chosen from, or sufficient data to fetch and interpret the options. All OptionSets have an `option_set_type` attribute that indicates the structure of the object that contains the options. The possible values are `options_array`, `equipment_category`, and `reference_list`. Other attributes on the OptionSet depend on the value of this attribute. - `options_array` - `options` (array): An array of Option objects. Each item in the array represents an option that can be chosen. - `equipmen.

D&D 5e API is an open data API from dnd5eapi.co. It needs no API key. It is served over HTTPS. Its OpenAPI description documents 47 endpoints.

## At a glance

- Category: [Open Data](https://www.openparable.com/apis/category/open-data)
- Provider: dnd5eapi.co
- Authentication: None (no API key)
- HTTPS: Yes
- CORS: Not stated
- Base URL: https://www.dnd5eapi.co
- Documentation: https://github.com/5e-bits
- OpenAPI description: https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/openapi.json
- Version: 0.1
- Specification updated: 2023-02-23

## Example request

```bash
curl -X GET "https://www.dnd5eapi.co/api" \
  -H "Accept: application/json"
```

## Endpoints

- `GET /api` — Get all resource URLs.
- `GET /api/ability-scores/{index}` — Get an ability score by index.
- `GET /api/alignments/{index}` — Get an alignment by index.
- `GET /api/backgrounds/{index}` — Get a background by index.
- `GET /api/classes/{index}` — Get a class by index.
- `GET /api/classes/{index}/features` — Get features available for a class.
- `GET /api/classes/{index}/levels` — Get all level resources for a class.
- `GET /api/classes/{index}/levels/{class_level}` — Get level resource for a class and level.
- `GET /api/classes/{index}/levels/{class_level}/features` — Get features available to a class at the requested level.
- `GET /api/classes/{index}/levels/{spell_level}/spells` — Get spells of the requested level available to the class.
- `GET /api/classes/{index}/multi-classing` — Get multiclassing resource for a class.
- `GET /api/classes/{index}/proficiencies` — Get proficiencies available for a class.
- `GET /api/classes/{index}/spellcasting` — Get spellcasting info for a class.
- `GET /api/classes/{index}/spells` — Get spells available for a class.
- `GET /api/classes/{index}/subclasses` — Get subclasses available for a class.
- `GET /api/conditions/{index}` — Get a condition by index.
- `GET /api/damage-types/{index}` — Get a damage type by index.
- `GET /api/equipment-categories/{index}` — Get an equipment category by index.
- `GET /api/equipment/{index}` — Get an equipment item by index.
- `GET /api/feats/{index}` — Get a feat by index.
- `GET /api/features/{index}` — Get a feature by index.
- `GET /api/languages/{index}` — Get a language by index.
- `GET /api/magic-items/{index}` — Get a magic item by index.
- `GET /api/magic-schools/{index}` — Get a magic school by index.
- `GET /api/monsters` — Get list of monsters with optional filtering
- `GET /api/monsters/{index}` — Get monster by index.
- `GET /api/proficiencies/{index}` — Get a proficiency by index.
- `GET /api/races/{index}` — Get a race by index.
- `GET /api/races/{index}/proficiencies` — Get proficiencies available for a race.
- `GET /api/races/{index}/subraces` — Get subraces available for a race.
- `GET /api/races/{index}/traits` — Get traits available for a race.
- `GET /api/rule-sections/{index}` — Get a rule section by index.
- `GET /api/rules/{index}` — Get a rule by index.
- `GET /api/skills/{index}` — Get a skill by index.
- `GET /api/spells` — Get list of spells with optional filtering.
- `GET /api/spells/{index}` — Get a spell by index.
- `GET /api/subclasses/{index}` — Get a subclass by index.
- `GET /api/subclasses/{index}/features` — Get features available for a subclass.
- `GET /api/subclasses/{index}/levels` — Get all level resources for a subclass.
- `GET /api/subclasses/{index}/levels/{subclass_level}` — Get level resources for a subclass and level.
- `GET /api/subclasses/{index}/levels/{subclass_level}/features` — Get features of the requested spell level available to the class.
- `GET /api/subraces/{index}` — Get a subrace by index.
- `GET /api/subraces/{index}/proficiencies` — Get proficiences available for a subrace.
- `GET /api/subraces/{index}/traits` — Get traits available for a subrace.
- `GET /api/traits/{index}` — Get a trait by index.
- `GET /api/weapon-properties/{index}` — Get a weapon property by index.
- `GET /api/{endpoint}` — Get list of all available resources for an endpoint.

## Questions

### Does the D&D 5e API API need an API key?

No. The D&D 5e API API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

### Does the D&D 5e API API support HTTPS?

Yes, the D&D 5e API API is served over HTTPS.

### How many endpoints does the D&D 5e API API have?

Its OpenAPI description lists 47 endpoints in version 0.1. All of them are shown on this page.

### What are alternatives to the D&D 5e API API?

Other Open Data APIs include Search Services, Wayback API, Wikipedia, Nasdaq Data Link, University of Oslo.

## Similar open data APIs

- [Search Services](https://www.openparable.com/apis/search-services): API for Internet Archive's Search-related services
- [Wayback API](https://www.openparable.com/apis/wayback): API for Internet Archive's Wayback Machine
- [Wikipedia](https://www.openparable.com/apis/wikipedia): Mediawiki Encyclopedia
- [Nasdaq Data Link](https://www.openparable.com/apis/nasdaq-data-link): The source for financial, economic, and alternative datasets, serving investment professionals.
- [University of Oslo](https://www.openparable.com/apis/university-of-oslo): Courses, lecture videos, detailed information for courses etc. for the University of Oslo (Norway)
- [Data API](https://www.openparable.com/apis/data): Serves the Clever Data API
- [Kaggle](https://www.openparable.com/apis/kaggle): Create and interact with Datasets, Notebooks, and connect with Kaggle
- [CollegeScoreCard.ed.gov](https://www.openparable.com/apis/collegescorecard-ed-gov): Data on higher education institutions in the United States
- [U.S. EPA Enforcement and Compliance History Online (ECHO) - All Data](https://www.openparable.com/apis/u-s-epa-enforcement-and-compliance-history-online-echo-all-data): Enforcement and Compliance History Online (ECHO) is a tool developed and maintained by EPA's Office of Enforcement and Compliance Assurance for public use. ECHO provides integrated compliance and enforcement information for over 1 million regulated facilities nationwide. ECHO Rest Services provide multiple service endpoints, each with specific capabilities, to search and retrieve data on facilities regulated as Clean Air Act (CAA) stationary sources, Clean Water Act (CWA) dischargers, Resource Conservation and Recovery Act (RCRA) hazardous waste generators/handlers, and Safe Drinking Water Act (SDWA) public water systems. Data of interest from other EPA sources, such as the Toxics Release Inventory, is also supplied for context. \ The get_facilities, get_map, get_qid, and get_download end points are meant to be used together, while the enhanced get_facility_info end point is self contained. The get_facility_info end point returns either an array of state, county or zip clusters with summary statistics per cluster or an array of facilities. \ The recommended use scenario for get_facilities, get_qid, get_map, and get_downoad is: \ <b>1)</b> Use get_facilities to validate passed query parameters, obtain summary statistics and to obtain a query_id (QID). QIDs are time sensitive and will be valid for approximately 30 minutes. <b>2)</b> Use get_qid, with the returned QID, to paginate through arrays of facility results. <b>3)</b> Use get_map, with the returned QID, to zoom in/out and pan on the clustered and individual facility coordinates that meet the QID query criteria. <b>4)</b> Use get_download, with the returned QID, to generate a Comma Separated Value (CSV) file of facility information that meets the QID query criteria. \ \ Use the qcolumns parameter to customize your search results. Use the Metadata service endpoint for a list of available output objects, their Column Ids, and their definitions to help you build your customized output. \ Additional ECHO Resources: <a href="https://echo.epa.gov/tools/web-services">Web Services</a>, <a href="https://echo.epa.gov/resources/echo-data/about-the-data">About ECHO's Data</a>, <a href="https://echo.epa.gov/tools/data-downloads">Data Downloads</a>
- [Authorized Partner API Specification](https://www.openparable.com/apis/authorized-partner-specification): To access files in user’s DigiLocker account from your application, you must first obtain user’s authorization.
- [GENESIS](https://www.openparable.com/apis/genesis): Federal Statistical Office Germany
- [Scoop.it](https://www.openparable.com/apis/scoop-it): Content Curation Service

Listed from: APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/d-d-5e (OpenParable). Cite the canonical URL above.
