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

# Chart a market's price

> Plot recorded asks, continued into archived history where recording started later.

`GET /v1/markets/{venue}/{id}/quotes` returns asks recorded each time they changed, oldest first. Where the window reaches back before recording began, earlier points are hourly or daily closes with `price_usd` instead of asks. A step chart shows both honestly: each price holds until the next.

```python Python theme={null}
import os
from datetime import datetime

import matplotlib.pyplot as plt
import requests

API = "https://api.routeur.app"
venue, market_id = "kalshi", os.environ["MARKET_ID"]

res = requests.get(f"{API}/v1/markets/{venue}/{market_id}/quotes", params={"days": 90},
                   headers={"X-API-Key": os.environ["ROUTEUR_API_KEY"]}, timeout=30)
res.raise_for_status()
quotes = res.json()["data"]

recorded, archived = [], []
for q in quotes:
    at = datetime.fromisoformat(q["observed_at"].replace("Z", "+00:00"))
    if q.get("yes_ask_usd"):
        recorded.append((at, float(q["yes_ask_usd"])))
    elif q.get("price_usd"):
        archived.append((at, float(q["price_usd"])))

fig, ax = plt.subplots(figsize=(10, 4))
if archived:
    ax.step(*zip(*archived), where="post", linestyle="--", label="Closing price (history)")
if recorded:
    ax.step(*zip(*recorded), where="post", label="Yes ask (recorded)")
ax.set_ylim(0, 1)
ax.set_ylabel("Price per $1 contract")
ax.set_title(market_id)
ax.legend()
plt.show()
```

## Notes

* **At most 5,000 points** per request. For long, busy windows, ask for fewer days.
* **The first point** is the last change before the window, so the line starts at the left edge.
* **Asks, not trades.** For what actually traded, read `GET /v1/markets/{venue}/{id}/trades`.
