API reference · Reference markets

Get reference bars

GET/v1/reference/bars

One reference market's bars on the same clock as the venues' markets, oldest first, paged by time, with any gaps in the recording.

On this page

Auth. An API token: Authorization: Bearer lb_… (create one). Signed-in web sessions work too.

Limits. One history query per call (500 a day on Free; unlimited on Builder and Standard).

Parameters

Query parameters

NameTypeRequiredDescription
symbolstringyesBTC-USD, ETH-USD, UST-10Y, … or source:symbol.
sourcestringnoThe source to read when several record the symbol.
periodstringnoSeconds, or 1s, 1m or 1d; default the finest stored.
sinceintegernoms epoch; bars whose period ends at or after it.
untilintegernoms epoch; bars whose period ends at or before it.
limitintegernoBars per page. 1 to 5000. Default 1000.

Request

Terminal
curl "https://api.langbot.ai/v1/reference/bars?symbol=UST-10Y&since=1793682000000&limit=2" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"

Response

200 OK

JSON
{
  "symbol": "UST-10Y",
  "source": "treasury",
  "source_name": "U.S. Treasury daily par yield curve",
  "rights": "public_domain",
  "period_s": 86400,
  "periods_available": [86400],
  "since": 1793682000000,
  "until": null,
  "count": 2,
  "bars": [
    { "ts": 1793768400000, "open": null, "high": null, "low": null, "close": 4.95, "volume": null, "trades": null, "bid_close": null, "ask_close": null, "as_of": "2026-11-03" },
    { "ts": 1793854800000, "open": null, "high": null, "low": null, "close": 4.90, "volume": null, "trades": null, "bid_close": null, "ask_close": null, "as_of": "2026-11-04" }
  ],
  "gaps": [],
  "next_since": 1793854800001
}

ts is the end of each bar, so the close is known at ts. Crypto bars: USD prices, volume in coins, trades fills, bid_close/ask_close the last top of book; prices are null for a period with quotes and no trade. Daily series: as_of is the date the value is for and ts when it was known; yields and rates are percent. gaps lists holes in the recording that overlap the page (disconnect, sequence with missed_trades, stale). Pass next_since back as since for the next page.

Errors

StatuscodeWhen
404not_foundNo reference series with that symbol, or none at period.
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_exceededToday's history queries 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.