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

NameTypeRequiredDescription
event_idstringyesA replayable event (ev_…).

Query parameters

NameTypeRequiredDescription
cursorstringnonext_cursor from the previous page's page line.
limitintegernoLines per page. 1 to 50,000. Default 20000.

Request

Terminal
curl "https://api.langbot.ai/v1/sim/events/ev_kxearningsmentiongs_26oct13/timeline?limit=2" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"

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

StatuscodeWhen
401auth_requiredNo token was sent.
401token_invalidThe token was not recognised (mistyped, revoked or expired).
422validation_errorA parameter failed validation; detail[].loc names it.
429quota_exceededThis month's Sim runs are spent; quota.resets_at says when they reset.
429rate_limitedOver your request budget; wait Retry-After seconds.

Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.