Authentication
Every endpoint except /openapi.json needs an API key. Send it in the Authorization header with theBearer scheme. Keys in query strings are not accepted.
curl https://marketcalendars.com/api/v2/markets/nyse/status \
-H "Authorization: Bearer mc_live_..."const res = await fetch("https://marketcalendars.com/api/v2/markets/nyse/status", {
headers: { Authorization: `Bearer ${process.env.MARKETCALENDARS_KEY}` },
});
const data = await res.json();import os, requests
res = requests.get(
"https://marketcalendars.com/api/v2/markets/nyse/status",
headers={"Authorization": f"Bearer {os.environ['MARKETCALENDARS_KEY']}"},
)
data = res.json()Keys
- A key looks like
mc_live_followed by 43 random letters and digits - Create keys under Account, API keys. You can have up to 5, each with a name
- The full key is shown once, when you create it. We store only a hash, the first 12 characters and the last 4
- The account page shows when each key was last used. Revoking a key takes effect immediately
- All keys on an account share its plan's quota
Keep keys secret
Call the API from your server, not from browser or mobile app code, where anyone can read the key. If a key leaks, revoke it and create a new one.
Missing or invalid keys
A request without a valid key gets a 401 response and does not count against your quota:
401 Unauthorized
{
"type": "https://marketcalendars.com/docs/api/errors#unauthorized",
"title": "Missing or invalid API key",
"status": 401,
"detail": "Send your key as Authorization: Bearer mc_live_...",
"instance": "/api/v2/markets/nyse/status"
}