Pages
Lists and history endpoints return one page at a time, withnext_cursor. Pass it back as cursor, with the same parameters, until it is null. limit sets the page size: up to 1,000 items on lists (100 by default); each history endpoint’s reference gives its own.
client.iter_market_prices(...) yields every row of every page.
Streams
History and tick endpoints also stream: one request returns every row of the window, however many there are. Send one of theseAccept headers:
Books stream as NDJSON only. Discovery and lifecycle don’t stream. Send
Accept-Encoding: gzip for large streams.
A stream costs what one page of its endpoint costs, and covers a longer window than a page:
Streams carry rows only. For Kalshi data, the attribution and the data type come in the
Qelso-Attribution and Qelso-Data-Type response headers.
When a stream breaks
A stream that ends normally has delivered every row we hold for the window. If anything fails after the first byte, the connection closes without finishing the response, so your HTTP client raises an error rather than ending quietly. Resume withafter= set to the last row you received:
outcome=no, the row’s own side and price); a partial last line isn’t a row. A resumed book-changes stream skips the starting book, so if it breaks before its first update row, start again without after.