Skip to content

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 toLimit
Each key60 requests per 60 seconds
No key, per IP10 requests per 60 seconds
Invalid keys, per IP10 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."
 }
}
StatuscodeMeaning
400invalid_requestA parameter is missing or malformed. message says which.
401invalid_keyThe key is wrong, rolled or revoked. A request with a wrong key is refused, not treated as one without a key.
404not_foundNo mission with that id, or it is no longer available.
405method_not_allowedOnly GET (and HEAD, OPTIONS) are supported.
429rate_limitedOver 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

NameTypeDescription
namestringFile name, case-insensitive, e.g. ewithin.hog. Without an extension (vertigo) it matches any extension.
sha256stringSHA-256 of the file, 64 hex digits.
md5stringMD5 of the file, 32 hex digits.
gamestringOnly this game: d1, d2, d3, xl, ol.

At least one of name, sha256 and md5 is required.

Response

FieldTypeDescription
queryobjectThe parameters as the API read them (name lower-cased).
filesarrayMatching files, most downloaded mission first. At most 50.
files[].namestringFile name, lower case.
files[].insidestring | nullThe HOG or .mn3 the file is inside, or null.
files[].sizeintegerSize in bytes.
files[].sha256stringSHA-256, lower-case hex.
files[].md5stringMD5, lower-case hex.
files[].missionMissionSee Mission.
morebooleantrue 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

NameTypeDescription
idintegerThe mission's id, as in files[].mission.id.

Response

A Mission with two more fields:

FieldTypeDescription
levelsarrayLevels in the order the mission file lists them, secret levels last.
levels[].nintegerPosition, from 1.
levels[].titlestring | nullThe level's name as the game shows it.
levels[].filestringThe level's file name.
levels[].secretbooleantrue for a secret level.
filesarrayEvery indexed file, each as in GET /files (without mission).

Example

curl "https://descentmissiondb.com/api/v1/missions/561"

Mission object

FieldTypeDescription
idintegerMission id.
namestringMission name.
versionstring | nullVersion, as the author gave it.
gamestringd1 (Descent), d2 (Descent II), d3 (Descent 3), xl (D2X-XL), ol (Overload)
kindstringmulti, single, challenge, ctf, team-anarchy, mod, hoard, team-hoard, entropy
authorsstring[]Author names, in credit order.
releasedstring | nullRelease date, YYYY-MM-DD.
urlstringThe mission's page on DMDB.
download.urlstringDownload URL for the mission's file. No key needed.
download.namestring | nullThe file's name, usually a .zip.
download.sizeinteger | nullThe 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.

Go to

↑↓ to moveEnter to openEsc to close

Send feedback