> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qelso.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sub-minute data

> The order book at any millisecond, prices down to 100 ms, and every best bid and ask change, book change and trade.

Below one minute, you can read a market three ways: a book at one instant, a grid of prices or books down to 100 milliseconds, or one row per event.

| You want | Endpoint | Access |
| - | - | - |
| The book at one millisecond | `GET /v2/markets/{market_id}/books?at=` | `subminute` |
| Books every second or 100 ms | `GET /v2/markets/{market_id}/books?start&end&interval=1s` | `subminute` |
| Prices or candles every second or 100 ms | `/prices` or `/candles` with `resolution=1s` or `100ms` | `subminute` |
| Every change of the best bid or ask | `GET /v2/markets/{market_id}/bbo` | `ticks`, with Ultra |
| Every change of the book, level by level | `GET /v2/markets/{market_id}/book-updates` | `ticks`, with Ultra |
| Every trade | `GET /v2/markets/{market_id}/trades` | `ticks` |

`GET /v2/usage` shows whether your key has `subminute` and `ticks` for each venue, and which datasets each one covers. Best bid and ask changes (`bbo`) and book changes (`book_updates`) come with Ultra, on both venues.

## What each venue has, and from when

| Data | Kalshi | Polymarket |
| - | - | - |
| Prices and candles at `1s` and `100ms`, best bid and ask changes | From 17 October 2026 | From 11 November 2026 |
| Books at a millisecond, sampled books below `1m`, book changes | From 17 October 2026 | From 11 November 2026 |
| Trades | From 30 June 2021 | The trades of each listed market, from its first (see [Trades](#trades)) |

`GET /v2/venues` gives the first time each dataset has data on each venue.

## The book at one millisecond

`books?at=` returns the book with every change at or before that millisecond applied. `last_change` is the time of the latest change it includes.

```bash curl theme={null}
curl -s "https://api.qelso.io/v2/markets/polymarket:3215007/books?at=2026-11-16T15:00:00.000Z&depth=5" \
  -H "X-API-Key: $QELSO_API_KEY"
```

```python Python theme={null}
book = client.get_market_books("polymarket:3215007", at="2026-11-16T15:00:00.000Z", depth=5).data[0]
print(book.bids[0], book.asks[0], book.last_change)  # [0.033, 9969.09] [0.034, 4198.74] 2026-11-16 14:59:56.643+00:00
```

`depth` is the number of price levels per side, best first, from 1 to 1,000, or `all`. It defaults to 10.

## Rebuilding the book yourself

`book-updates` (with Ultra) gives the book as it stood just before `start`, then every price-level change in `[start, end)`. Apply the rows in order and you hold the full book at every moment of the window.

* The starting book comes first, as `kind: snapshot` rows, one per level, at every depth. A large book can run over several pages.
* If we didn't hold the market's book just before `start` (before the first book we hold, or some time after it settled), there are no snapshot rows: start from an empty book. The first book we hold then arrives as `update` rows.
* Then come `kind: update` rows. `size` is the level's size after the change, and 0 means the level was removed. `delta` is the change from before.
* Rows come in `(ts, seq, side, price)` order. The rows of one change share their `ts` and `seq`.

```python theme={null}
book = {"bid": {}, "ask": {}}
for row in client.stream_market_book_updates(
    "polymarket:3215007", start="2026-11-16T14:00:00Z", end="2026-11-16T15:00:00Z"
):
    levels = book[row.side]
    if row.size == 0:
        levels.pop(row.price, None)
    else:
        levels[row.price] = row.size
    best_bid = max(book["bid"], default=None)
    best_ask = min(book["ask"], default=None)
```

## Prices and candles below a minute

`prices` and `candles` take `resolution=1s` or `100ms`, with the same rules as at `1m`: each row covers `[t, t + resolution)` and gives its values as of the interval's end. So the last `1s` row of a minute matches that minute's `1m` row, and a minute's `1s` candles add up to its `1m` candle. A page holds up to 10,000 points and 6 hours; a stream up to 24 hours.

## Best bid and ask changes

`bbo` (with Ultra) gives one row each time the best bid or the best ask changes, in price or in size, with both sides' price and size. An empty side has a null price and size. The first two rows of `kalshi:KXFEDDECISION-26DEC-H0` from 15:00 UTC on 16 November 2026:

```json theme={null}
{"ts": "2026-11-16T15:03:43.422Z", "seq": 1, "bid": 0.04, "bid_size": 6570, "ask": 0.05, "ask_size": 432}
{"ts": "2026-11-16T15:03:43.450Z", "seq": 1, "bid": 0.04, "bid_size": 6570, "ask": 0.05, "ask_size": 216}
```

Powered by Kalshi Research.

## Trades

`trades` gives every trade, ordered by `(ts, seq)`. That is execution order, except on Kalshi before 18 October 2026: trades there that share a `ts` keep a fixed order, which may not be the order they executed in. `price` is in terms of the outcome you asked for, and `aggressor` says whether the taker bought or sold it (`unknown` where the venue doesn't say). Combo trades are not included.

On Polymarket:

* **One row per maker order's fill.** A taker order that fills three resting orders gives three rows, with the same transaction hash in `trade_id` (`<transaction hash>:<log index>`), in the order the chain recorded them. Trade counts in candles count fills the same way, and volume counts each share once.
* **`ts` is a whole second:** when the trade settled, typically about 2 seconds after it matched. So a trade can't be placed exactly among the book changes of those seconds.
* **`size`** is the shares filled, before any fee.
* **Which markets:** the trades of each market the API lists, from its first. That includes markets that closed before August 2025: they have trades from 21 November 2022, but no minute prices or books.

## Windows, costs and limits

| Endpoint | Window per page | Window per stream | Units |
| - | - | - | - |
| Books at `at`, sampled books below `1m`, prices and candles at `1s` and `100ms` | ≤ 6 hours (books also ≤ 100,000 intervals) | 24 hours (books also ≤ 100,000 intervals) | 5 |
| Best bid and ask, book changes | ≤ 6 hours | 24 hours | 10 |
| Trades | ≤ 31 days | 31 days | 10 |

* Each organisation may run at most 4 sub-minute or tick requests, 2 streams and 2 list or search requests at once.
* Tick rows count toward your plan's monthly row quota, in pages and in streams, like every data row ([Limits](https://docs.qelso.io/concepts/limits.md#monthly-quotas)).
* For a long period, stream it a day at a time.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.