TypeScript SDK — Market Data: Books, Trades & Candles
Order book snapshots, public trade history, and OHLCV candlestick data. All methods are on client.marketData. All methods in this group are public (no authentication required) and backed by GET requests, so they auto-retry on transient failures (429, 502, 503, 504).
Prices, quantities, and amounts are decimal strings. See Data Types for safe handling.
getCurrentOrderBook
GET /v1/book/{symbol} · Public
Returns the current order book as two arrays of bid and ask price levels. Each level includes a price, amount, and timestamp — all as strings.
Code
The second argument (query params) is optional. Available query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit_bids | number | 50 | Max bid levels to return. 0 = full book. |
limit_asks | number | 50 | Max ask levels to return. 0 = full book. |
Tip: This endpoint returns a point-in-time snapshot. For a continuously-updated local order book, use the SDK's
client.orderBook(symbol)helper — see Order Book Reconstruction for how it applies WebSocket depth diffs to stay synchronized.
Caveat: Prices and quantities are returned as strings, not numbers. Treating them as floats risks precision loss. See Data Types.
listTrades
GET /v1/trades/{symbol} · Public
Returns public trade history for a symbol, sorted newest first. Each request returns at most 500 records and is limited to seven calendar days of data.
Code
Available query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
timestamp | number | — | Only return trades after this timestamp (seconds or ms since epoch). 90-day hard limit. |
since_tid | number | — | Only return trades after this trade ID. Overrides timestamp if both are set. Use 0 for earliest available data. |
limit_trades | number | 50 | Maximum trades to return (up to 500). |
include_breaks | boolean | false | Whether to include broken (reversed) trades. |
Tip: To poll for new trades (forward pagination), pass the highest
tidfrom your last batch assince_tid. The API returns trades with IDs strictly greater than the value you provide, so you won't see duplicates. Note thattidin the response is abigintwhilesince_tidin the query is typed asnumber— convert withNumber(trade.tid)for values within safe integer range, or usetrade.tid.toString()and parse back if needed.
Note: This endpoint is limited to seven calendar days of data. Contact Gemini for access to extended market data.
listCandles
GET /v2/candles/{symbol}/{time_frame} · Public
Returns OHLCV (open, high, low, close, volume) candlestick data. Each candle is an array of [timestamp, open, high, low, close, volume].
Code
Supported time_frame values:
| Value | Interval |
|---|---|
"1m" | 1 minute |
"5m" | 5 minutes |
"15m" | 15 minutes |
"30m" | 30 minutes |
"1h" | 1 hour |
"6h" | 6 hours |
"1d" | 1 day |
Note: Candle values (open, high, low, close, volume) are numbers in this endpoint's response, not strings. This differs from most other market data endpoints.
listDerivativeCandles
GET /v2/derivatives/candles/{symbol}/{time_frame} · Public
Returns OHLCV candlestick data for perpetual derivative pairs. Currently only the "1m" time frame is supported.
Code
Note: Only
"1m"is available for derivative candles. Passing any other time frame will result in an error. For spot candles with more time frames, use listCandles.
What's next
- Symbols & Pricing — symbol discovery, ticker data, and price feeds
- Networks & Derivatives — network/token lookups, FX rates, and funding data
- Order Book Reconstruction — how the SDK maintains a live local order book from WebSocket diffs
- Data Types — decimal strings,
biginttimestamps, and safe arithmetic - Full API Specifications — complete request/response schemas