Skip to main content
The Orderbook History API serves historical orderbook data — snapshots and incremental deltas — collected from Kalshi, Gemini, and Polymarket US. Base URL: http://data.graylayer.tech
History begins from March 7, 2026. Queries with start_ts before this date will be clamped to the earliest available data.

Getting a key

API keys are issued via Discord. Join the server, go to the Community tab, and post a request in #api-key-request.

Join the Graylayer Discord

Request an API key in #api-key-request under the Community tab.

Supported exchanges

Exchange valuePlatform
kalshiKalshi elections prediction markets
geminiGemini crypto & prediction markets
polymarket_usPolymarket US prediction markets

Authentication

All data endpoints require an x-api-key header:
curl -H "x-api-key: your_key" \
  http://data.graylayer.tech/api/kalshi/tickers
Requests without an API key are treated as anonymous — rate limited per IP with access restricted to the last 1 day of data.

API key access control

Keys can optionally restrict:
FieldDescription
requests_per_minuteRate limit for this key
max_data_age_daysHow far back queries can reach. Omit = unlimited
ticker_prefixesRestrict to tickers matching these prefixes (case-insensitive). Omit = all tickers
full_history_prefixesTickers matching these prefixes bypass max_data_age_days

Rate limiting

Uses per-minute token buckets (one limiter per key, one per IP for anonymous). Rate limiters are in-memory and reset on restart. When exceeded:
HTTP 429 Too Many Requests
{"error": "rate limit exceeded"}

Anonymous access

Requests without x-api-key:
  • Rate limited per IP (default: 10 req/min)
  • Data restricted to the last 1 day regardless of start_ts
  • IP is read from X-Forwarded-For if the service is behind a proxy (trust_proxy = true in config)