Skip to main content

Quick start

The Glitchmug API is a JSON REST API at https://api.glitchmug.com/v1 (the same API is also served at https://glitchmug.com/api/v1, which the site uses). The website is just its first client: everything you see there, you can read here.

  • Reading published mods, games, users and collections needs no key.
  • Writing (creating mods, uploading files, commenting, webhooks) needs an API key.

1. Check the API is up​

#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"

curl -fsS "$BASE_URL/health"

2. List mods​

Lists are filtered with query parameters and paged with a cursor. See Pagination & filters.

#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"

# First page; pass page.nextCursor back as ?cursor= for the next one
curl -fsS "$BASE_URL/mods?game=deadlock&sort=downloads&limit=5"

3. Create an API key​

Sign in on glitchmug.com, open Settings → API keys and create a key. The secret is shown once. Export it:

export GLITCHMUG_TOKEN=gm_xxxxxxxx_yyyyyyyy

4. Call an authenticated endpoint​

#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${GLITCHMUG_API:-https://api.glitchmug.com/v1}"

curl -fsS "$BASE_URL/me" \
-H "Authorization: Bearer $GLITCHMUG_TOKEN"

Next​