🔮Madjik docs

Authentication

How to authenticate API requests.

All /v1/ data endpoints require an API key. Get one at madjik.io/pricing — after checkout your key is provisioned automatically and sent to your inbox.

Using your key

Send it in the X-API-Key header (preferred) or as a bearer token — both work:

curl -H "X-API-Key: YOUR_API_KEY" "https://api.madjik.io/v1/metrics/M10004"

curl -H "Authorization: Bearer YOUR_API_KEY" "https://api.madjik.io/v1/metrics/M10004"

Python

import requests

BASE = "https://api.madjik.io/v1"
headers = {"X-API-Key": "YOUR_API_KEY"}

r = requests.get(f"{BASE}/metrics/M10004", headers=headers)
r.raise_for_status()
print(r.json())

JavaScript

const r = await fetch("https://api.madjik.io/v1/metrics/M10004", {
  headers: { "X-API-Key": "YOUR_API_KEY" }
});
const data = await r.json();

Error responses

CodeMeaningExample detail
401Missing or invalid keyAPI key required. Provide via X-API-Key header or Authorization: Bearer <key>
403Subscription inactive, trial expired, or metric above your tierMetric M50021 requires enterprise tier or higher
429Rate or usage limit exceededRate limit exceeded. Your plan allows 30 requests per minute.

Keep your key server-side. Never ship it in client-side code or commit it to a repository.