D&D 5e API
dnd5eapi · 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 [curl](http://curl.haxx.se/) or [httpie](http://http
Authentication
Sample Requests
Making a request to the API's base URL returns an object containing available endpoints.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get list of monsters with optional filtering
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters?challenge_rating=example"
import requests
params = {
"challenge_rating": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters');
url.searchParams.set('challenge_rating', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters")
q := baseURL.Query()
q.Set("challenge_rating", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters")
uri.query = URI.encode_www_form({
"challenge_rating" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/monsters?" . http_build_query([
"challenge_rating" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get list of spells with optional filtering.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells?level=example&school=example"
import requests
params = {
"level": "example",
"school": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells');
url.searchParams.set('level', 'example');
url.searchParams.set('school', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells")
q := baseURL.Query()
q.Set("level", "example")
q.Set("school", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells")
uri.query = URI.encode_www_form({
"level" => "example",
"school" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/dnd5eapi.co/0.1/api/spells?" . http_build_query([
"level" => "example",
"school" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with D&D 5e API?
D&D 5e API is a Data API. Developers commonly use data APIs for:
- enriching your app with third-party datasets
- building data pipelines and ETL workflows
- querying and searching large datasets
- powering research, analysis, and reporting tools
- syncing reference data into your own systems
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. D&D 5e API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?