Getting Started with the API
From zero to your first authenticated request in five minutes.
1. Create an API key
Sign in, then visit /user/api-keys and click Create key. The raw key is displayed once — copy it somewhere safe (a password manager or your shell's env-var store). The site only stores a SHA-256 hash, so a lost key cannot be recovered; you'll have to revoke it and create a new one.
Free tier gives you 100 requests/day with a 60/minute burst. Need more? See API pricing.
2. Authenticate
Send your key on every request as a Bearer token:
curl https://iwantmymtg.net/api/v1/sets \
-H "Authorization: Bearer iwm_live_..."
The X-API-Key
header is also accepted if a Bearer token is awkward in your client.
3. Make your first call
Look up a card by name:
curl "https://iwantmymtg.net/api/v1/cards?q=lightning+bolt&limit=1" \
-H "Authorization: Bearer iwm_live_..."
Every response is wrapped in a standard envelope:
{ "data": ..., "meta": ... }.
The full schema for each endpoint is in the
API reference.
4. Watch your rate-limit headers
Every response includes:
X-RateLimit-Limit— your daily quotaX-RateLimit-Remaining— calls left todayX-RateLimit-Reset— Unix timestamp of the next reset (UTC midnight)
When you hit the limit you'll get a 429 with an upgrade-prompt message. The per-minute burst limit is enforced separately and resets every 60 seconds.
5. Where to next?
- API reference — every endpoint
- Discord price bot tutorial
- Portfolio export tutorial