Skip to main content
GET
/
v1
/
chart
/
history
Get historical bars (OHLCV data)
curl --request GET \
  --url https://api.tradearies.dev/v1/chart/history \
  --header 'Authorization: Bearer <token>' \
  --header 'X-API-Key: <api-key>'
{
  "s": "ok",
  "errmsg": "<string>",
  "t": [
    123
  ],
  "o": [
    123
  ],
  "h": [
    123
  ],
  "l": [
    123
  ],
  "c": [
    123
  ],
  "v": [
    123
  ],
  "nextTime": 123
}
This endpoint returns historical Open, High, Low, Close, and Volume (OHLCV) data in UDF format. Use this to populate charts with historical price data.
Supported Resolutions:
  • Seconds: 1S, 5S, 10S, 15S, 30S
  • Minutes: 1, 5, 15, 30, 60, 240
  • Daily/Weekly/Monthly: 1D, 1W, 1M
Set firstDataRequest=1 on the initial request to extend the date range backward by 5 days, ensuring sufficient historical context for technical indicators.

Authorizations

X-API-Key
string
header
required
Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

symbol
string
required

Symbol identifier for the security

Example:

"AAPL"

resolution
enum<string>
required

Bar resolution/timeframe. Supported values: 1S, 5S, 10S, 15S, 30S (seconds), 1, 5, 15, 30, 60, 240 (minutes), 1D (day), 1W (week), 1M (month)

Available options:
1S,
5S,
10S,
15S,
30S,
1,
5,
15,
30,
60,
240,
1D,
1W,
1M
Example:

"1D"

from
integer
required

Start time as Unix timestamp (seconds)

Example:

1672531200

to
integer
required

End time as Unix timestamp (seconds)

Example:

1704067200

firstDataRequest
enum<string>
default:0

Flag indicating if this is the first data request (0 or 1). When set to 1, extends the date range backward by 5 days

Available options:
0,
1

Response

Historical bars retrieved successfully

s
enum<string>
required

Status of the response

Available options:
ok,
no_data,
error
errmsg
string

Error message if status is 'error'

t
integer[]

Array of timestamps (Unix epoch in seconds)

o
number[]

Array of open prices

h
number[]

Array of high prices

l
number[]

Array of low prices

c
number[]

Array of close prices

v
integer[]

Array of volume values

nextTime
integer

Timestamp of the next available bar (used when s='no_data')