integrations.sh
← all integrations

D&D 5e API

OpenAPI apis-guru open_data

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 or 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 .

GraphQL

This API supports . 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}

DC

Represents a difficulty check.

DC {  dc_type       APIReference  dc_value      number  success_type  "none" | "half" | "other"}

Damage

Represents damage.

Damage {  damage_type     APIReference  damage_dice     string}

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" )

Choice {  desc      string  choose    number  type      string  from      OptionSet}

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.
  • equipment_category
    • equipment_category (APIReference): A reference to an EquipmentCategory. Each item in the EquipmentCategory's equipment array represents one option that can be chosen.
  • resource_list
    • resource_list_url (string): A reference (by URL) to a collection in the database. The URL may include query parameters. Each item in the resulting ResourceList's results array represents one option that can be chosen.

Option

When the options are given in an options_array, each item in the array inherits from the Option structure. All Options have an option_type attribute that indicates the structure of the option. The value of this attribute indicates how the option should be handled, and each type has different attributes. The possible values and their corresponding attributes are listed below.

  • reference - A terminal option. Contains a reference to a Document that can be added to the list of options chosen.
    • item (APIReference): A reference to the chosen item.
  • action - A terminal option. Contains information describing an action, for use within Multiattack actions.
    • action_name (string): The name of the action, according to its name attribute.
    • count (number | string): The number of times this action can be repeated if this option is chosen.
    • type (string = "melee" | "ranged" | "ability" | "magic", optional): For attack actions that can be either melee, ranged, abilities, or magic.
  • multiple - When this option is chosen, all of its child options are chosen, and must be resolved the same way as a normal option.
    • items (array): An array of Option objects. All of them must be taken if the option is chosen.
  • choice - A nested choice. If this option is chosen, the Choice structure contained within must be resolved like a normal Choice structure, and the results are the chosen options.
    • choice (Choice): The Choice to resolve.
  • string - A terminal option. Contains a reference to a string.
    • string (string): The string.
  • ideal - A terminal option. Contains information about an ideal.
    • desc (string): A description of the ideal.
    • alignments (ApiReference[]): A list of alignments of those who might follow the ideal.
  • counted_reference - A terminal option. Contains a reference to something else in the API along with a count.
    • count (number): Count.
    • of (ApiReference): Thing being referenced.
  • score_prerequisite - A terminal option. Contains a reference to an ability score and a minimum score.
    • ability_score (ApiReference): Ability score being referenced.
    • minimum_score (number): The minimum score required to satisfy the prerequisite.
  • ability_bonus - A terminal option. Contains a reference to an ability score and a bonus
    • ability_score (ApiReference): Ability score being referenced
    • bonus (number): The bonus being applied to the ability score
  • breath - A terminal option: Contains a reference to information about a breath attack.
    • name (string): Name of the breath.
    • dc (DC): Difficulty check of the breath attack.
    • damage ([Damage]): Damage dealt by the breath attack, if any.
  • damage - A terminal option. Contains information about damage.
    • damage_type (ApiReference): Reference to type of damage.
    • damage_dice (string): Damage expressed in dice (e.g. "13d6").
    • notes (string): Information regarding the damage.

FAQ

What is the SRD?

The SRD, or Systems Reference Document, contains guidelines for publishing content under the OGL. This allows for some of the data for D&D 5e to be open source. The API only covers data that can be found in the SRD.

What is the OGL?

The Open Game License (OGL) is a public copyright license by Wizards of the Coast that may be used by tabletop role-playing game developers to grant permission to modify, copy, and redistribute some of the content designed for their games, notably game mechanics. However, they must share-alike copies and derivative works.

A monster, spell, subclass, etc. is missing from the API / Database. Can I add it?

Please check if the data is within the SRD. If it is, feel free to open an issue or PR to add it yourself. Otherwise, due to legal reasons, we cannot add it.

Can this API be self hosted?

Yes it can! You can also host the data yourself if you don't want to use the API at all. You can also make changes and add extra data if you like. However, it is up to you to merge in new changes to the data and API.

Can I publish is on ? Is this free use?

Yes, you can. The API itself is under the , and the underlying data accessible via the API is supported under the SRD and OGL.

Status Page

The status page for the API can be found here:

Chat

Come hang out with us !

Contribute

This API is built from two repositories.

  • The repo containing the data lives here:
  • The repo with the API implementation lives here:

This is a evolving API and having fresh ideas are always welcome! You can open an issue in either repo, open a PR for changes, or just discuss with other users in this discord.

Homepage
https://api.apis.guru/v2/specs/dnd5eapi.co/0.1.json
Provider
dnd5eapi.co
OpenAPI version
3.0.1
Spec (JSON)
https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/openapi.json
Spec (YAML)
https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/openapi.yaml

Tools (49)

Extracted live via the executor SDK.

  • characterData.getApiAbilityScoresIndex

    Ability Score

    Represents one of the six abilities that describes a creature's physical and mental characteristics. The three main rolls of the game - the ability check, the saving throw, and the attack roll - rely on the ability scores. []

  • characterData.getApiAlignmentsIndex

    Alignment

    A typical creature in the game world has an alignment, which broadly describes its moral and personal attitudes. Alignment is a combination of two factors: one identifies morality (good, evil, or neutral), and the other describes attitudes toward society and order (lawful, chaotic, or neutral). Thus, nine distinct alignments define the possible combinations.[]

  • characterData.getApiBackgroundsIndex

    Background

    Every story has a beginning. Your character's background reveals where you came from, how you became an adventurer, and your place in the world. Choosing a background provides you with important story cues about your character's identity. []

    Note: acolyte is the only background included in the SRD.

  • characterData.getApiLanguagesIndex

    Language

    Your race indicates the languages your character can speak by default, and your background might give you access to one or more additional languages of your choice. []

  • characterData.getApiProficienciesIndex

    Proficiency

    By virtue of race, class, and background a character is proficient at using certain skills, weapons, and equipment. Characters can also gain additional proficiencies at higher levels or by multiclassing. A characters starting proficiencies are determined during character creation.

  • characterData.getApiSkillsIndex

    Skill

    Each ability covers a broad range of capabilities, including skills that a character or a monster can be proficient in. A skill represents a specific aspect of an ability score, and an individual's proficiency in a skill demonstrates a focus on that aspect. []

  • class.getApiClassesIndex

    Class

    A character class is a fundamental part of the identity and nature of characters in the Dungeons & Dragons role-playing game. A character's capabilities, strengths, and weaknesses are largely defined by its class. A character's class affects a character's available skills and abilities. []

  • class.getApiClassesIndexMultiClassing

    Get multiclassing resource for a class.

  • class.getApiClassesIndexSpellcasting

    Get spellcasting info for a class.

  • classLevels.getApiClassesIndexLevels

    Get all level resources for a class.

  • classLevels.getApiClassesIndexLevelsClassLevel

    Get level resource for a class and level.

  • classLevels.getApiClassesIndexLevelsClassLevelFeatures

    Get features available to a class at the requested level.

  • classLevels.getApiClassesIndexLevelsSpellLevelSpells

    Get spells of the requested level available to the class.

  • classResourceLists.getApiClassesIndexFeatures

    Get features available for a class.

  • classResourceLists.getApiClassesIndexProficiencies

    Get proficiencies available for a class.

  • classResourceLists.getApiClassesIndexSpells

    Get spells available for a class.

  • classResourceLists.getApiClassesIndexSubclasses

    Get subclasses available for a class.

  • common.getApi

    Making a request to the API's base URL returns an object containing available endpoints.

  • common.getApiEndpoint

    Currently only the and endpoints support filtering with query parameters. Use of these query parameters is documented under the respective and sections.

  • equipment.getApiEquipmentCategoriesIndex

    These are the categories that various equipment fall under.

  • equipment.getApiEquipmentIndex

    Equipment

    Opportunities abound to find treasure, equipment, weapons, armor, and more in the dungeons you explore. Normally, you can sell your treasures and trinkets when you return to a town or other settlement, provided that you can find buyers and merchants interested in your loot.

  • equipment.getApiMagicItemsIndex

    These are the various magic items you can find in the game.

  • equipment.getApiWeaponPropertiesIndex

    Get a weapon property by index.

  • feats.getApiFeatsIndex

    Feat

    A feat is a boon a character can receive at level up instead of an ability score increase.

  • features.getApiFeaturesIndex

    Feature

    When you gain a new level in a class, you get its features for that level. You don’t, however, receive the class’s starting Equipment, and a few features have additional rules when you’re multiclassing: Channel Divinity, Extra Attack, Unarmored Defense, and Spellcasting.

  • gameMechanics.getApiConditionsIndex

    Condition

    A condition alters a creature’s capabilities in a variety of ways and can arise as a result of a spell, a class feature, a monster’s attack, or other effect. Most conditions, such as blinded, are impairments, but a few, such as invisible, can be advantageous.

  • gameMechanics.getApiDamageTypesIndex

    Damage type

    Different attacks, damaging spells, and other harmful effects deal different types of damage. Damage types have no rules of their own, but other rules, such as damage resistance, rely on the types.

  • gameMechanics.getApiMagicSchoolsIndex

    Magic School

    Academies of magic group spells into eight categories called schools of magic. Scholars, particularly wizards, apply these categories to all spells, believing that all magic functions in essentially the same way, whether it derives from rigorous study or is bestowed by a deity.

  • monsters.getApiMonsters

    Get list of monsters with optional filtering

  • monsters.getApiMonstersIndex

    Get monster by index.

  • races.getApiRacesIndex

    Each race grants your character ability and skill bonuses as well as racial traits.

  • races.getApiRacesIndexProficiencies

    Get proficiencies available for a race.

  • races.getApiRacesIndexSubraces

    Get subraces available for a race.

  • races.getApiRacesIndexTraits

    Get traits available for a race.

  • rules.getApiRuleSectionsIndex

    Rule sections represent a sub-heading and text that can be found underneath a rule heading in the SRD.

  • rules.getApiRulesIndex

    Rule

    Rules are pages in the SRD that document the mechanics of Dungeons and Dragons. Rules have descriptions which is the text directly underneath the rule heading in the SRD. Rules also have subsections for each heading underneath the rule in the SRD.

  • spells.getApiSpells

    Get list of spells with optional filtering.

  • spells.getApiSpellsIndex

    Get a spell by index.

  • subclasses.getApiSubclassesIndex

    Subclasses reflect the different paths a class may take as levels are gained.

  • subclasses.getApiSubclassesIndexFeatures

    Get features available for a subclass.

  • subclasses.getApiSubclassesIndexLevels

    Get all level resources for a subclass.

  • subclasses.getApiSubclassesIndexLevelsSubclassLevel

    Get level resources for a subclass and level.

  • subclasses.getApiSubclassesIndexLevelsSubclassLevelFeatures

    Get features of the requested spell level available to the class.

  • subraces.getApiSubracesIndex

    Subraces reflect the different varieties of a certain parent race.

  • subraces.getApiSubracesIndexProficiencies

    Get proficiences available for a subrace.

  • subraces.getApiSubracesIndexTraits

    Get traits available for a subrace.

  • traits.getApiTraitsIndex

    Get a trait by index.

  • openapi.previewSpec

    Preview an OpenAPI document before adding it as a source

  • openapi.addSource

    Add an OpenAPI source and register its operations as tools