REST API + WebSocket
Integrate programmatically with OFFCODE. Public market data, authenticated trading with API keys, WebSocket for real-time tickers and orders.
REST API
HTTPS endpoints for market data, trading and wallet.
https://offcode.pro/api/
WebSocket
Real-time streams of tickers, orderbook and fills.
wss://offcode.pro/ws
Public endpoints (no auth)
| Method | Path | Description |
|---|---|---|
| GET | /api/market/pairs | Universe of available perp + spot pairs |
| GET | /api/market/candles?symbol=BTCUSDC&interval=5m&limit=500 | OHLCV candles |
| GET | /api/market/depth?symbol=BTCUSDC&limit=50 | L2 orderbook |
| GET | /api/market/trades?symbol=BTCUSDC&limit=50 | Recent trades |
| GET | /api/pricing/ticker/BTCUSDC | Ticker for a single pair |
| GET | /api/pricing/tickers?symbols=BTCUSDC,ETHUSDC | Tickers in batch |
WebSocket channels
After connecting, send a subscribe payload:
{
"type": "subscribe",
"channels": ["ticker:BTCUSDC", "trades:ETHUSDC"]
}
Available channels:
ticker:<SYMBOL>— price, bid/ask, 24h volumetrades:<SYMBOL>— recent fillsorderbook:<SYMBOL>— book snapshot + deltaorders:user— events for your orders (auth)balances:user— balance updates (auth)
Authenticated API keys
For trading and account operations, generate an API key at /api-keys with a specific scope:
read— read balances, orders and historytrade— open, cancel and modify orderswithdraw— request withdrawals (rare scope, additional gate)
Authentication via the X-OFFCODE-Key header + HMAC signature of the payload. Technical questions? Contact support.
Rate limits
- Public:
60 req/minper IP - Authenticated:
600 req/minper API key - WebSocket:
100 subscribesper connection, no limit on inbound messages
The X-RateLimit-Remaining response header indicates remaining calls. Exceeding it returns HTTP 429 with Retry-After.
Risk warning. Programmatic trading amplifies execution speed and risk. Poorly configured bots can generate losses quickly. This documentation does not constitute investment advice. Test extensively before trading with real capital.
Official SDK, complete examples and more endpoints in the docs under construction. Questions? /contact