Market data
Read markets, order books, trades and candles from Time Seventeen with REST snapshots and WebSocket pushes, and keep a local book in sync.
Snapshots over REST
| Data | Request |
|---|---|
| Markets, terms, touch and last price | GET /v2/markets |
| Order book (L2) and best bid/offer | GET /v2/book/{market} with x-t17-depth: N |
| Order book by order (MBO) | GET /v2/mbo/{market} |
| Catalog: events, titles, settlement rules | GET https://testnet.timeseventeen.com/api/catalog |
| 24-hour statistics of every market | GET …/api/markets/summary |
| Candles | GET …/api/markets/{slug}/bars?resolution=1&from=&to= |
| Recent trades with aggressor side | GET …/api/markets/{slug}/trades?limit=60 |
Prices in gateway responses are integer ticks (1 tick = $0.000001). The site endpoints (/api/…) return dollars.
Pushes over WebSocket
Subscribe once and receive every change as it is committed:
{"op": "subscribe", "markets": [1, 2], "channels": ["trades", "l2", "bbo"]}Each push is {"type": "md", "events": [...]} with level, bbo and trade events. Every event carries its market’s public seq.
Keeping a local book
- Subscribe first, then request a snapshot:
{"op": "book", "market": 1, "depth": 100, "view": "l2"}. The reply carriesmd_seq. - Apply only events with
seq > md_seq. Alevelevent gives the absolute quantity at a price; quantity 0 removes the level. - On reconnect, send
resumewith the lastseqyou hold per market. If the server no longer has that history it answersRESNAPSHOTand you start again from step 1.
The order book never crosses: if your local best bid is ever at or above your best ask, you have missed events — re-snapshot.
Full message reference: WebSocket.