Custom Bars (OHLC)

GET
/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}

Retrieve aggregated historical OHLC (Open, High, Low, Close) and value data for a specified index over a custom date range and time interval in Eastern Time (ET). Unlike stocks or options, these aggregates are derived from index values rather than individual trades, reflecting the performance of a market segment, sector, or benchmark. If no index updates occur within a given timeframe, no aggregate bar is produced, resulting in an empty interval that indicates a period without new index data. Users can customize their view by adjusting the multiplier and timespan parameters (e.g., a 5-minute interval). This approach supports various analytical and visualization needs related to broad market or sector performance.

Use Cases: Data visualization, market trend analysis, benchmark comparisons, research and modeling.

Path Parameters
indicesTicker
string
required
The ticker symbol of Index.
multiplier
integer
required
The size of the timespan multiplier.
timespan
enum (string)
required
The size of the time window.
from
string
required
The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.
to
string
required
The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.
Query Parameters
sort
enum (string)
Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top).
limit
integer
Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements.
Response Attributes
ticker
string
The exchange symbol that this item is traded under.
queryCount
integer
The number of aggregates (minute or day) used to generate the response.
request_id
string
A request id assigned by the server.
resultsCount
integer
The total number of results for this request.
status
string
The status of this request's response.
results
array (object)
optional
An array of results containing the requested data.
c
number
The close value for the symbol in the given time period.
h
number
The highest value for the symbol in the given time period.
l
number
The lowest value for the symbol in the given time period.
o
number
The open value for the symbol in the given time period.
t
integer
The Unix millisecond timestamp for the start of the aggregate window.
Code Examples
Query URL
GET
Log in or Sign up to Polygon to run a query. It's free.
Scroll to see updated query response
Response Object
Did you find this page helpful?
Do you still need help with something?