Dungeon Master AI

Dungeon Master AI · Acciones GPT

D&D 5E API

API providing data related to Dungeons and Dragons 5th Edition

  • GET /classesList all classes
  • GET /classes/{classId}Get a specific class by ID
  • GET /racesList all races
  • GET /spellsList all spells
Esquema original API
{
  "openapi": "3.0.0",
  "info": {
    "title": "D&D 5E API",
    "version": "1.0.0",
    "description": "API providing data related to Dungeons and Dragons 5th Edition"
  },
  "servers": [
    {
      "url": "https://www.dnd5eapi.co/api/"
    }
  ],
  "paths": {
    "/classes": {
      "get": {
        "summary": "List all classes",
        "operationId": "listClasses",
        "responses": {
          "200": {
            "description": "A list of classes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Class"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/classes/{classId}": {
      "get": {
        "summary": "Get a specific class by ID",
        "operationId": "getClassById",
        "parameters": [
          {
            "name": "classId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed information about a class",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Class"
                }
              }
            }
          }
        }
      }
    },
    "/races": {
      "get": {
        "summary": "List all races",
        "operationId": "listRaces",
        "responses": {
          "200": {
            "description": "A list of races",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Race"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/spells": {
      "get": {
        "summary": "List all spells",
        "operationId": "listSpells",
        "responses": {
          "200": {
            "description": "A list of spells",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Spell"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Class": {
        "type": "object",
        "properties": {
          "index": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "hit_die": {
            "type": "integer"
          },
          "proficiencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "saving_throws": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subclasses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Race": {
        "type": "object",
        "properties": {
          "index": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "speed": {
            "type": "integer"
          },
          "ability_bonuses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "alignment": {
            "type": "string"
          },
          "age": {
            "type": "string"
          },
          "size": {
            "type": "string"
          },
          "size_description": {
            "type": "string"
          },
          "starting_proficiencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language_desc": {
            "type": "string"
          },
          "traits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subraces": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Spell": {
        "type": "object",
        "properties": {
          "index": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "desc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "range": {
            "type": "string"
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "material": {
            "type": "string"
          },
          "ritual": {
            "type": "string"
          },
          "duration": {
            "type": "string"
          },
          "concentration": {
            "type": "string"
          },
          "casting_time": {
            "type": "string"
          },
          "level": {
            "type": "integer"
          },
          "school": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}