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
| Code | Meaning | Example detail |
|---|---|---|
401 | Missing or invalid key | API key required. Provide via X-API-Key header or Authorization: Bearer <key> |
403 | Subscription inactive, Free trial ended, feature or portfolio size above your plan | Portfolio value $150 exceeds the Free (30-day trial) plan limit of $100. |
429 | Speed or daily limit exceeded (see Retry-After) | Rate limit: the Starter plan allows one call every 30 s. Retry in 12.4 s. |
Keep your key server-side. Never ship it in client-side code or commit it to a repository.