Вы находитесь на странице: 1из 3

Bars API

The bars API provides time-aggregated price and volume data.

[GET] Get a list of bars


GET /v1/bars/{timeframe}

Retrieves a list of bars for each requested symbol. It is guaranteed all bars are in ascending order by
time.

Currently, no “incomplete” bars are returned. For example, a 1 minute bar for 09:30 will not be
returned until 09:31.

Parameters

Path Parameters

string
- timeframe
One of minute, 1Min, 5Min, 15Min, day or 1D. minute is an alias of
1Min. Similarly, day is of 1D.

Query Parameters

string Required
- symbols
One or more (max 200) symbol names split by commas (“,”).

integer
- limit
The maximum number of bars to be returned for each symbol. It can be
between 1 and 1000. Default is 100 if parameter is unspeci ed or 0.

timestamp
- start
Filter bars equal to or after this time. Cannot be used with after.

timestamp
- end
Filter bars equal to or before this time. Cannot be used with until.

timestamp
- after Filter bars after this time. Cannot be used with start.

timestamp
- until
Filter bars before this time. Cannot be used with end.

Response

An object with a key for each symbol and the Bars object as the values.

Note that it returns status 200 with an empty object if no requested symbol is found.

Errors
422 Unprocessable The parameters are not well formed.

Bars Entity

Example
{
"AAPL": [
{
"t": 1544129220,
"o": 172.26,
"h": 172.3,
"l": 172.16,
"c": 172.18,
"v": 3892,
}
]
}

Properties
int
-t
the beginning time of this bar as a Unix epoch in seconds

number
-o
open price

number
-h
high price

number
-l
low price
number
-c
close price

number
-v
volume

Suggestions or questions?
We're always happy to hear from you. You can contribute to these docs on GitHub, or
you can join our Community Slack to get help from other community members and the
Alpaca team.

Вам также может понравиться