Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.

Query Parameters

instrument
string
required

The symbol, or a spread expression using + - * / ^, parentheses and numbers over up to four symbols. A spread bar exists only where every symbol in it has a bar for that interval, and its volume is 0. A string that exactly matches a catalog symbol is always that symbol, never arithmetic, even when it contains a / or a -.

tf
string
required

The timeframe, such as 1m, 4h, 1d or 100t. /api/market/config lists what is accepted.

from
integer

The start of the window, in epoch seconds, inclusive.

to
integer

The end of the window, in epoch seconds, inclusive.

countBack
integer

Return the last this many bars at or before to, for scrolling back. It takes priority over from. When there are no bars, the answer carries noData: true, your signal to stop scrolling back. When every bar is older than the window you asked for, because the market was closed, the answer carries stale: true, so you never mistake Friday's bars for a live Saturday session.

Response

The bars.

The bars for one symbol and timeframe, oldest first.

instrument
string
required

The symbol the bars are for.

tf
string
required

The timeframe of the bars.

bars
object[]
required

The bars, oldest first.

noData
boolean

Present, and true, only when a countBack request found no bars at all.

stale
boolean

Present, and true, only when every bar returned is older than the window the countBack request asked for.