REST endpoints
Every Time Seventeen REST endpoint — markets, books, account, orders, enrollment, health, catalog, candles and account history — with request and response examples.
Gateway endpoints live on https://api-testnet.timeseventeen.com; browsers use the same paths under https://testnet.timeseventeen.com/api/gw. Site endpoints live on https://testnet.timeseventeen.com/api.
Gateway
GET /v2/markets
Every market with its terms and touch. Prices in ticks.
{"markets": [{
"market": 1, "status": "Open", "md_seq": 7746590,
"best_bid": 492052, "best_ask": 506409, "last": 506409,
"terms": {"face": 1000000, "min_price": 1, "max_price": 999999, "min_qty": 1, "max_qty": 1000000000,
"qty_step": 1, "min_notional": 1, "maker_fee_bps": 0, "taker_fee_bps": 0,
"self_trade": "CancelTaker", "session_end": 18446744073709551615}
}]}GET /v2/book/{market}
Order book snapshot (L2) with best bid/offer. Header x-t17-depth: N limits levels per side.
{"bids": [[492052, 1046], [486814, 686]], "asks": [[506409, 1769], [514396, 238]],
"bbo": {"bid": 492052, "bid_qty": 1046, "ask": 506409, "ask_qty": 1769},
"last": 506409, "status": "Open", "md_seq": 7746590}Levels are [price ticks, contracts], bids descending, asks ascending. 404 UNKNOWN_MARKET for an unknown id.
GET /v2/mbo/{market}
Order-by-order snapshot in priority order, with anonymous orderRefs. Available where the gateway carries MBO; otherwise use the WebSocket mbo channel on a gateway that does.
GET /v2/account/{account}
Signed read (headers x-t17-ts, x-t17-signature). Cash in ticks.
{"account": 1001, "seq": 28703027,
"balance": {"cash": 10000000000, "reserved": 2500000, "open_orders": 1, "permissions": 3, "fee_tier": 0},
"positions": [{"market": 1, "position": {"yes": 120, "no": 0}}],
"open_orders": [{"id": 4299262263297, "market": 1, "outcome": "Yes", "side": "Buy", "price": 250000, "remaining": 10, "tif": "Gtc"}],
"pending_withdrawals": []}Errors: 401 SIGNATURE_REQUIRED, 401 SIGNATURE_INVALID, 404 UNKNOWN_ACCOUNT.
POST /v2/orders
Body: one or more signed frames, Content-Type: application/octet-stream. Returns once every command is durable:
{"results": [
{"Applied": {"seq": 28703100, "events": [
{"Accepted": {"id": 4299262263297, "account": 1001, "market": 1, "leg": "BuyYes", "price": 250000, "qty": 10}},
{"Fill": {"market": 1, "price": 250000, "no_price": 750000, "qty": 4, "taker_leaves": 6, "...": "…"}},
{"Book": {"...": "…"}}
]}},
{"Refused": "Replay"}
]}HTTP errors: 400 EMPTY_BATCH, 413 BODY_TOO_LARGE, 429 RATE_LIMITED, 403 NOT_PERMITTED, 503 BUSY/SERVICE_CLOSED.
POST /v2/enroll
Links a public key to an account with a one-time invite. Core only: use https://testnet.timeseventeen.com/api/gw/v2/enroll.
{"account": 1001, "invite": "t17i_…", "public_key": "ea4a6c63…d22c"}200 {"registered": true} · 401 INVALID_INVITE · 400 INVALID_PUBLIC_KEY.
POST /v2/sessions/password
Changes your own FIX or BOE session password: {"protocol": "fix", "name": "<SenderCompID>", "password": "…", "new_password": "…"}.
GET /v2/health
{"status": "…"} for monitoring. No authentication.
Site
GET /api/catalog
Events and their markets: titles, settlement conditions, outcome labels. See Testnet markets.
GET /api/markets/summary
24-hour figures per market (dollars): last, change24hPct, volume24h (contracts), notional24h, high24h, low24h.
GET /api/markets/{slug}/bars
Candles of YES trades. Query: resolution (1, 5, 15, 60, 240, 1D), from, to (Unix seconds), limit (≤ 2,000). Returns {"bars": [{"time" (ms), "open", "high", "low", "close", "volume"}]}.
GET /api/markets/{slug}/trades
Latest trades: ?limit= up to 200. {"trades": [{"time", "price", "qty", "side"}]} where side is the aggressor in YES terms (buy lifted an ask).
GET /api/account/{account}/fills
Signed like an account read. Your fills, newest first: ?limit= (≤ 500) and ?before=seq:idx to page.
{"fills": [{"seq": 28703100, "idx": 1, "time": 1795018917585, "market": 1, "price": 250000, "qty": 4,
"role": "taker", "leg": 0, "fee": 0}]}leg: 0 Buy YES, 1 Buy NO, 2 Sell YES, 3 Sell NO. price is the YES price; the NO price is 1,000,000 − price.
GET /api/account/{account}/positions
Signed. Average entry price, realised profit and fees per market and outcome, computed from your fills: {"holdings": [{"market", "outcome", "qty", "avg", "realized", "fees", "complete"}]} (ticks).