API reference · Sim
Get a timeline
GET/v1/sim/events/{event_id}/timeline
One page of an event's merged timeline (feed events and order books in replay order) as NDJSON, to run your own strategy locally.
On this page
Auth. An API token: Authorization: Bearer lb_… (create one). Signed-in web sessions work too.
Limits. One Sim run (20 a month on Free, 100 on Builder, unlimited on Standard).
Parameters
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
event_id | string | yes | A replayable event (ev_…). |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | no | next_cursor from the previous page's page line. |
limit | integer | no | Lines per page. 1 to 50,000. Default 20000. |
Request
curl "https://api.langbot.ai/v1/sim/events/ev_kxearningsmentiongs_26oct13/timeline?limit=2" \
-H "Authorization: Bearer $LANGBOT_API_TOKEN"from langbot import LangbotClient
async with LangbotClient() as lb: # reads LANGBOT_API_TOKEN
async for line in lb.sim_timeline_lines("ev_kxearningsmentiongs_26oct13"):
print(line)const res = await fetch("https://api.langbot.ai/v1/sim/events/ev_kxearningsmentiongs_26oct13/timeline?limit=2", {
headers: { Authorization: `Bearer ${process.env.LANGBOT_API_TOKEN}` },
});
console.log(await res.json());Response
200 OK
{"kind":"manifest","v":1,"event_id":"ev_kxearningsmentiongs_26oct13","window":{"from":1760362200000,"to":1760369400000},"markets":[{"ticker":"KXEARNINGSMENTIONGS-26OCT13-PRIV","result":"yes"}],"delay_ms":0,"fee_model":{"kalshi":"…"},"default_latency_ms":[250,2250,5250]}
{"kind":"book","ticker":"KXEARNINGSMENTIONGS-26OCT13-PRIV","ts":1760362201000,"yes_bid":0.41,"yes_ask":0.44,"bids":[[0.41,120]],"asks":[[0.44,80]]}
{"kind":"event","id":"evt_01K7…","type":"phrase_detected","phrase":"private credit","t_emitted":1760362450000}
{"kind":"page","count":2,"next_cursor":"eyJ0Ijo…"}application/x-ndjson: a manifest line, then event and book lines, then a page line with next_cursor (null on the last page). Only the first page counts as a Sim run. langbot sim run -s my_bot.py reads it for you.
Errors
| Status | code | When |
|---|---|---|
| 401 | auth_required | No token was sent. |
| 401 | token_invalid | The token was not recognised (mistyped, revoked or expired). |
| 422 | validation_error | A parameter failed validation; detail[].loc names it. |
| 429 | quota_exceeded | This month's Sim runs are spent; quota.resets_at says when they reset. |
| 429 | rate_limited | Over your request budget; wait Retry-After seconds. |
Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.