Market.ai REST API Reference
Complete reference for the Market.ai REST API. All endpoints return JSON and require authentication unless noted otherwise.
Authentication
All endpoints except /health require an API key passed via the Authorization header.
Authorization: Bearer mk_live_abc123...
API keys follow the format mk_live_<32 chars> for production and mk_test_<32 chars> for testing. Keys are hashed with SHA-256 before storage -- Market.ai never stores plaintext keys.
Missing or invalid key:
{
"ok": false,
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}
Response Format
All successful responses use this envelope:
{
"ok": true,
"data": { ... },
"meta": {
"timestamp": 1708776300000
}
}
All error responses use this envelope:
{
"ok": false,
"error": {
"code": "not_found",
"message": "Quote for symbol 'INVALID' not found",
"retry_after": 60
}
}
The retry_after field is only present on 429 (rate limited) responses and indicates seconds until the limit resets.
Rate Limiting
Rate limits are enforced per API key and vary by subscription tier. Every response includes these headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per day |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp (seconds) when the limit resets |
Tier limits:
| Tier | Price | REST/day | MCP/day | WS Connections | WS Symbols | Chat/day | Webhooks | Credentials |
|---|---|---|---|---|---|---|---|---|
| Free | $0 | 500 | 200 | 1 | 5 | 50 | 1 | 1 |
| Basic | $4.99/mo | 10,000 | 5,000 | 5 | 25 | 500 | 5 | 3 |
| Pro | $9.99/mo | 100,000 | 50,000 | 15 | 100 | 5,000 | 25 | 10 |
| Max | $24.99/mo | Unlimited | Unlimited | 50 | Unlimited | Unlimited | Unlimited | Unlimited |
When a rate limit is exceeded, you receive a 429 response:
{
"ok": false,
"error": {
"code": "rate_limited",
"message": "Daily rate limit exceeded",
"retry_after": 3600
}
}