GET
/
marketdata
/
candles
Get candles
curl --request GET \
  --url https://openapi.ainvest.com/open/marketdata/candles \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "data": [
      {
        "t": 123,
        "o": 123,
        "h": 123,
        "l": 123,
        "c": 123,
        "v": 123
      }
    ]
  },
  "status_code": 123,
  "status_msg": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your key. Get the key here

Query Parameters

ticker
string
required

US stock market ticker symbol, e.g. AAPL, TSLA, etc.

interval
enum<string>
required

Aggregation interval for the requested data

Available options:
min,
day,
week,
month,
year
step
integer
required

Aggregation step for each candle. For example, interval=day&step=1 for daily candles, interval=min&step=15 for 15-minute candles.

from
integer
required

Start of the requested period, unix timestamp with milliseconds

to
integer
default:0

End of the requested period, unix timestamp with milliseconds. Default value of 0 represents the latest available data.

session
enum<string>
default:regular

Trading session, regular - only include data for regular trading session, all - return data including premarket, regular and postmarket

Available options:
regular,
all

Response

200
application/json

Successful response in standard envelope.

The response is of type object.