---
title: "Order-book microstructure history"
method: GET
path: "/prediction/markets/{market_id}/book/history"
tags: ["prediction"]
---

# Order-book microstructure history

`GET /prediction/markets/{market_id}/book/history`

## Request

- Base URL: `https://kresmion.com/v1`
- URL: `https://kresmion.com/v1/prediction/markets/{market_id}/book/history`
- Auth: HTTP bearer

Time series of one market's stored CLOB microstructure — best bid/ask, mid, spread, near-mid resting depth (within 1% and 5% of mid, USDC), and top-of-book size — oldest-first for charting. Source: pm_orderbook_snapshots, captured every ~15 min for the top ~150 live markets by 24h volume plus the pinned 2026 midterm markets ONLY (a market outside that set has no book history). Collection began 2026-07-16, so the window is shallow: `as_of` is the latest snapshot and `meta.rows` the count actually returned. The depth bands are RELATIVE to the mid (1% of a 3-cent mid is 0.03 cents), so on a low-priced market the 1% band can sit inside the spread and `*_depth_1pct` then reads 0: that 0 means the band is narrower than the gap to the best quote, not an empty book (compare `mid - best_bid` and `best_ask - mid` with `0.01 * mid`; `top_bid_size` / `top_ask_size` give the size at the touch). The heavy per-level ladders are omitted unless `include_levels=true` (the JSONB top-5 bid/ask levels are bulky). Describes the book; never touches it.

## Path parameters

- `market_id` string, required

## Query parameters

- `hours` integer: Look-back window in hours (max 30 days).
- `limit` integer
- `include_levels` boolean: Include the top-5 bid/ask level ladders (heavy JSONB).

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kresmion/apis/kresmion-api.md) · [All operations](https://skmtc.dev/kresmion/apis/kresmion-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kresmion/apis/kresmion-api/revisions/a94962dddccb?raw)
