Developers
API reference
Look up missions by file name and checksum. The API is read only and returns JSON.
- Base URL
- https://descentmissiondb.com/api/v1
- Format
- JSON, UTF-8
- Auth
- None needed. An API key, one per member, raises the limit
Authentication
You can call the API without a key, at a lower rate limit per IP address. That is enough for a game looking up a mission a player is missing. For a tool that makes more requests, use an API key. You need a DMDB account with a confirmed email to get one. Create it on your account page. It is shown once. Rolling it there replaces it, and the old key stops working immediately.
Send the key in the Authorization header:
Authorization: Bearer dmdb_...
X-API-Key: dmdb_... is also accepted. Keys in the query string are not. Keep your key out of anything you publish, such as source code or a game’s config file. Admins can revoke a key that is misused.
Rate limits
| Applies to | Limit |
|---|---|
| Each key | 60 requests per 60 seconds |
| No key, per IP | 10 requests per 60 seconds |
| Invalid keys, per IP | 10 requests per 60 seconds |
Over the limit, requests get 429 with a Retry-After header in seconds. Successful responses can be cached for 5 minutes (Cache-Control: private, max-age=300).
Errors
Errors use standard HTTP status codes and return an error object:
{
"error": {
"code": "invalid_key",
"message": "The API key is not valid. It may have been rolled or revoked."
}
}| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. message says which. |
| 401 | invalid_key | The key is wrong, rolled or revoked. A request with a wrong key is refused, not treated as one without a key. |
| 404 | not_found | No mission with that id, or it is no longer available. |
| 405 | method_not_allowed | Only GET (and HEAD, OPTIONS) are supported. |
| 429 | rate_limited | Over the rate limit. Wait Retry-After seconds. |
GET /api/v1/files
Find files by name, checksum, or both. Every parameter you send must match.
Query parameters
| Name | Type | Description |
|---|---|---|
| name | string | File name, case-insensitive, e.g. ewithin.hog. Without an extension (vertigo) it matches any extension. |
| sha256 | string | SHA-256 of the file, 64 hex digits. |
| md5 | string | MD5 of the file, 32 hex digits. |
| game | string | Only this game: d1, d2, d3, xl, ol. |
At least one of name, sha256 and md5 is required.
Response
| Field | Type | Description |
|---|---|---|
| query | object | The parameters as the API read them (name lower-cased). |
| files | array | Matching files, most downloaded mission first. At most 50. |
| files[].name | string | File name, lower case. |
| files[].inside | string | null | The HOG or .mn3 the file is inside, or null. |
| files[].size | integer | Size in bytes. |
| files[].sha256 | string | SHA-256, lower-case hex. |
| files[].md5 | string | MD5, lower-case hex. |
| files[].mission | Mission | See Mission. |
| more | boolean | true if there were more than 50 matches. |
Example
curl "https://descentmissiondb.com/api/v1/files?name=ewithin.hog&sha256=e94852af90c0845e73e3e73549bc25754bf0346b52e47b67ae094c2826a44c76"
{
"query": {
"name": "ewithin.hog",
"sha256": "e94852af90c0845e73e3e73549bc25754bf0346b52e47b67ae094c2826a44c76",
"md5": null,
"game": null
},
"more": false,
"files": [
{
"name": "ewithin.hog",
"inside": null,
"size": 28731053,
"sha256": "e94852af90c0845e73e3e73549bc25754bf0346b52e47b67ae094c2826a44c76",
"md5": "4e3c17d956afc659d9b5ba1244c49cfe",
"mission": {
"id": 561,
"name": "The Enemy Within",
"version": "1.0.0",
"game": "d2",
"kind": "single",
"authors": [
"Darkflamewolf"
],
"released": "2012-07-27",
"url": "https://descentmissiondb.com/missions/561/the-enemy-within",
"download": {
"url": "https://descentmissiondb.com/missions/561/download",
"name": "TEW.zip",
"size": 11395812
}
}
}
]
}GET /api/v1/missions/{id}
One mission, with its levels and every indexed file.
Path parameters
| Name | Type | Description |
|---|---|---|
| id | integer | The mission's id, as in files[].mission.id. |
Response
A Mission with two more fields:
| Field | Type | Description |
|---|---|---|
| levels | array | Levels in the order the mission file lists them, secret levels last. |
| levels[].n | integer | Position, from 1. |
| levels[].title | string | null | The level's name as the game shows it. |
| levels[].file | string | The level's file name. |
| levels[].secret | boolean | true for a secret level. |
| files | array | Every indexed file, each as in GET /files (without mission). |
Example
curl "https://descentmissiondb.com/api/v1/missions/561"
Mission object
| Field | Type | Description |
|---|---|---|
| id | integer | Mission id. |
| name | string | Mission name. |
| version | string | null | Version, as the author gave it. |
| game | string | d1 (Descent), d2 (Descent II), d3 (Descent 3), xl (D2X-XL), ol (Overload) |
| kind | string | multi, single, challenge, ctf, team-anarchy, mod, hoard, team-hoard, entropy |
| authors | string[] | Author names, in credit order. |
| released | string | null | Release date, YYYY-MM-DD. |
| url | string | The mission's page on DMDB. |
| download.url | string | Download URL for the mission's file. No key needed. |
| download.name | string | null | The file's name, usually a .zip. |
| download.size | integer | null | The file's size in bytes. |
The download is the mission’s file exactly as its author uploaded it, usually a zip, so a client has to extract it. Show the mission name and authors, and link to url, wherever you use a mission.
What’s indexed
For every mission with a downloadable file, up to 500 files per mission:
- the downloaded file itself, if it is 64 MB or smaller
- levels, mission files (.msn, .mn2, .mission), HOGs and .mn3s inside it, and inside a zip within it (one level deep). Each file 64 MB or smaller, 256 MB in total. Zip entries must be stored or deflated.
- every file inside those HOGs and .mn3s
Overload levels (.mp, .cm, .sp) are not indexed. Checksums are of the files as uploaded, so a repacked or edited file won’t match. When a mission’s file is replaced, its files are re-indexed within seconds; until then they don’t match anything. Members upload .zip files; the archive’s older .rar and .7z missions are indexed inside too.
Descent netgames
A Descent or Descent II netgame gives joining players the mission name (up to 8 characters, e.g. vertigo) and a 16-bit checksum of the loaded level’s segments. That checksum can’t be computed from the file, so it can’t be looked up here. Several missions share a name, so a name alone may return more than one result.
To fetch the right mission, the host should send the SHA-256 of its HOG (or of its .rdl / .rl2 for a single-level mission), and the joining client should call GET /files?name=<name>&sha256=<hash>.
Versioning
The version is in the path (/api/v1). Fields may be added to v1 responses at any time; ignore fields you don’t know. Removing or changing a field means a new version.