API Documentation

Integrate RateMap data into your trading infrastructure. Use REST for broad compatibility and WebSocket for low-latency live updates.

Authentication

Two ways to authenticate

Web users authenticate with a Bearer JWT. API clients can use the X-API-Key header where supported.

Web users

JWT

Pass the token in the Authorization header as a Bearer JWT.

GET /api/v1/rates/all HTTP/1.1 Host: ratemap.reylith.com Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

API calls

API Key

Use the X-API-Key header for service-to-service access where enabled.

GET /api/v1/opportunities HTTP/1.1 Host: ratemap.reylith.com X-API-Key: rm_...
REST API

Core endpoints

These endpoints are the foundation for dashboards, alerting services, and batch analytics.

EndpointPurposeNotes
GET
GET /api/v1/rates/all
All exchange live ratesRealtime funding overview across tracked venues
GET
GET /api/v1/opportunities
Opportunity scannerCross-exchange arbitrage opportunities
GET
GET /api/v1/public/fri/current
Current FRILatest Funding Rate Index snapshot
GET
GET /api/v1/public/fri/history?days=7
FRI historyHistorical FRI series for charting
WebSocket API

Live streaming for Pro & Enterprise

Use the WebSocket stream when you need fast updates and lower latency than REST polling.

Pro & EnterpriseFree users use REST polling.
Connection limit and entitlement are enforced server-side.
Connect
wss://ratemap.reylith.com/ws/rates?token=JWT
Subscribe message
{ "type": "subscribe", "filters": { "exchanges": ["binance", "bybit"], "symbols": ["BTCUSDT", "ETHUSDT"], "min_net_annual": 20 } }

Empty arrays mean subscribe to everything.

Server push
{ "type": "rate_update", "data": { "exchange": "binance", "symbol": "BTCUSDT", "rate": 0.0001, "net_annual": 32.4, "opportunity_score": 78, "timestamp": "2026-05-20T10:00:00Z" } }
Heartbeat

The server sends {"type":"ping"} every 30 seconds. Reply with{"type":"pong"}. A connection that stays silent for 90 seconds is closed.

Reconnect

Use exponential backoff: 1s → 2s → 4s → 8s → 16s → 30s max.

Close codes
  • 1008: JWT invalid or missing
  • 4001: Permission denied
  • 4003: Permission denied
JavaScript example
const ws = new WebSocket('wss://ratemap.reylith.com/ws/rates?token=' + encodeURIComponent(token)) ws.onopen = () => { ws.send(JSON.stringify({ type: 'subscribe', filters: { exchanges: ['binance', 'bybit'], symbols: ['BTCUSDT', 'ETHUSDT'], min_net_annual: 20, }, })) } ws.onmessage = (event) => { const msg = JSON.parse(event.data) if (msg.type === 'ping') { ws.send(JSON.stringify({ type: 'pong' })) } if (msg.type === 'rate_update') { console.log('update', msg.data) } }
Export API

Download tick-level funding rate data for backtesting

Export historical funding data in JSON or CSV for research, modeling, and backtests.

Pro & EnterpriseTick-level export for backtesting and research.
JSON export
GET /api/v1/export/rates.json
ParameterTypeDescription
exchangestring, optionalExchange name, e.g. binance
symbolstring, optionalTrading pair, e.g. BTCUSDT
start_datedate, optionalStart date in YYYY-MM-DD format
end_datedate, optionalEnd date in YYYY-MM-DD format
limitint, optionalMax rows. Pro up to 5000, Enterprise up to 10000
GET /api/v1/export/rates.json?exchange=binance&symbol=BTCUSDT&start_date=2026-04-01&end_date=2026-04-30&limit=5000
{ "limit": 5000, "rows": [ { "exchange": "binance", "symbol": "BTCUSDT", "rate_8h": 0.0001, "rate_annual": 36.5, "open_interest_usd": 1230000000, "volume_24h_usd": 890000000, "collected_at": "2026-04-30T08:00:00+00:00" } ] }
CSV download
GET /api/v1/export/rates.csv

Parameters are the same as the JSON endpoint. The response returns text/csv, which is suitable for Excel or pandas imports.

Export limits
PlanLimitRange
ProUp to 5000 rowsDate range limited to 30 days
EnterpriseUp to 10000 rowsNo date restriction
Rate Limits

Plan-based access

WebSocket access is included for higher tiers. REST access is rate-limited to protect the service.

PlanLimitNotes
FreeNo API accessREST polling only
Starter100 req/dayREST polling only
Pro1,000 req/day + WebSocketRecommended for active trading workflows
EnterpriseCustom + WebSocketBest for desks and internal tooling
Errors

Common HTTP responses

These are the most common errors you will see while integrating RateMap APIs.

StatusMeaningAction
401Missing or invalid JWTSend a valid Bearer token in Authorization.
403API key rejected or tier blockedCheck entitlement or use a higher plan.
429Rate limitedBack off and retry with a lower request frequency.
5xxServer side errorRetry later or inspect service health.
Integration note

REST is the safest default. Use WebSocket for live dashboards, alert engines, and trade monitoring systems that need lower latency.

Production ready