Skip to main content

Candles
High Usage

Get historical price candles for a stock.

Endpoint

https://api.marketdata.app/v1/stocks/candles/{resolution}/{symbol}/

Method

GET

Request Example

Response Example

{
"s": "ok",
"c": [217.68, 221.03, 219.89],
"h": [222.49, 221.5, 220.94],
"l": [217.19, 217.1402, 218.83],
"o": [221.03, 218.55, 220],
"t": [1569297600, 1569384000, 1569470400],
"v": [33463820, 24018876, 20730608]
}

Request Parameters

  • resolution string

    The duration of each candle.

    • Minutely Resolutions: (minutely, 1, 3, 5, 15, 30, 45, ...)
    • Hourly Resolutions: (hourly, H, 1H, 2H, ...)
    • Daily Resolutions: (daily, D, 1D, 2D, ...)
    • Weekly Resolutions: (weekly, W, 1W, 2W, ...)
    • Monthly Resolutions: (monthly, M, 1M, 2M, ...)
    • Yearly Resolutions:(yearly, Y, 1Y, 2Y, ...)
  • symbol string

    The company's ticker symbol.

  • from date

    The leftmost candle on a chart (inclusive). If you use countback, to is not required. Accepted timestamp inputs: ISO 8601, unix, spreadsheet.

  • to date

    The rightmost candle on a chart (inclusive). Accepted timestamp inputs: ISO 8601, unix, spreadsheet.

  • countback number

    Will fetch a number of candles before (to the left of) to. If you use from, countback is not required.

Response Attributes

  • s string

    ll always be ok when there is data for the candles requested.

  • o array[number]

    Open price.

  • h array[number]

    High price.

  • l array[number]

    Low price.

  • c array[number]

    Close price.

  • v array[number]

    Volume.

  • t array[number] Candle time (Unix timestamp, UTC). Daily, weekly, monthly, yearly candles are returned without times.