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:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per day
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp (seconds) when the limit resets

Tier limits:

TierPriceREST/dayMCP/dayWS ConnectionsWS SymbolsChat/dayWebhooksCredentials
Free$0500200155011
Basic$4.99/mo10,0005,00052550053
Pro$9.99/mo100,00050,000151005,0002510
Max$24.99/moUnlimitedUnlimited50UnlimitedUnlimitedUnlimitedUnlimited

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
  }
}

Endpoints

Health

Account

Quotes

Orderbook

Signals

Funding Rates

Liquidations

Arbitrage

Klines (OHLCV)

Exchanges

Polymarket

Search (Vector)

Replay (Historical)

Webhooks

Credentials

Chat