Historical bars
GET {{baseUrl}}/v2/stocks/bars?symbols=AAPL,TSLA&timeframe=1Min
The historical stock bars API provides aggregates for a list of stock symbols between the specified dates.
The returned results are sorted by symbol first then by bar timestamp. This means that you are likely to see only one symbol in your first response if there are enough bars for that symbol to hit the limit you requested on that request.
In these situations if you keep requesting again with the next_page_token
you will eventually reach the next symbols if any bars were found for them.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
symbols | string | (Required) Comma separated list of symbols. | |
timeframe | string | (Required) The timeframe of the bar aggregation. 5Min for example creates 5 minute aggregates. | |
You can use the following values: |
- [1-59]Min / T
- [1-23]Hour / H
- 1Day / D
- 1Week / W
- [1,2,3,4,6,12]Month / M
|
|
start
| string | | The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the beginning of the current day. | |end
| string | | The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the current time. | |limit
| number | | The maximum number of data points to return in the response. The API may return less, even if there are more available data points in the requested interval. Always check the next_page_token for more pages. The limit applies to the total number of data points, not per symbol! | |adjustment
| string | | Specifies the corporate action adjustment for the stocks. | |asof
| string | | The asof date of the queried stock symbol(s) in YYYY-MM-DD format. Default is the current day.
This date is used to identify the underlying entity of the provided symbol(s) so that name changes for this entity can be found. Data for past symbol(s) is returned if the query date range spans the name change.
The special value of "-" means symbol mapping is skipped. Data is returned based on the symbol alone without looking up previous names. The same happens if the queried symbol is not found on the given asof date.
Example: FB was renamed to META in 2022-06-09. Querying META with an asof date after
2022-06-09 will also yield FB data. The data for the FB ticker will be labeled as META
because they are considered the same underlying entity as of 2022-06-09.
Querying FB with an asof date after 2022-06-09 will only return data with the FB ticker,
not with META. But with an asof date before 2022-06-09, META will also be returned (as FB).
|
| feed
| string | | The source feed of the data. sip
contains all US exchanges, iex
contains only the Investors Exchange. otc
contains over the counter exchanges. Default: sip
for the non-latest endpoints or if the user has the unlimited subscription, iex
otherwise.
|
| currency
| string | | The currency of all prices in ISO 4217 format. Default is USD.
|
| page_token
| string | | Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. |
| sort
| string | | Sort data in ascending or descending order. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"bars":{"AAPL":[{"t":"2022-01-03T09:00:00Z","o":178.26,"h":178.26,"l":178.21,"c":178.21,"v":1118,"n":65,"vw":178.235733}]},"next_page_token":"QUFQTHxNfDIwMjItMDEtMDNUMDk6MDA6MDAuMDAwMDAwMDAwWg=="}