Get prices within a time range
https://pyth.dourolabs.app/v1/{channel}/price/rangeAn API key or short-lived access token, in an Authorization: Bearer <token> header.
Returns prices for the requested feeds within a time range. Both boundaries are inclusive, and the range cannot exceed 60 seconds.
Results are paginated. To request the next page, pass the response's next value as the after parameter.
v1/{channel}/price/rangecurl "https://pyth.dourolabs.app/v1/real_time/price/range?ids=1&ids=2&start_timestamp=1758830400000000&end_timestamp=1758830401000000" \
-H "Authorization: Bearer $PYTH_API_KEY"{
"data": [
{
"channel": 1,
"channel_name": "real_time",
"price_feed_id": 1,
"publish_time": 1758830400000000,
"confidence": 1927180465,
"exponent": -8,
"market_session": "regular",
"price": 10939852841644
},
{
"channel": 1,
"channel_name": "real_time",
"price_feed_id": 2,
"publish_time": 1758830400000000,
"confidence": 101285480,
"exponent": -8,
"market_session": "regular",
"price": 391287537937
}
],
"next": "WzE3NTg4MzA0MDAwMDAwMDAsMl0"
}Replace the placeholders in the URL path with these values.
channelRequiredThe channel that determines the update frequency.
Add these parameters to the URL query string.
idsinteger[]RequiredIDs of the price feeds to retrieve. At most 100.
start_timestampstringRequiredStart of the time range, in Unix microseconds. This boundary is inclusive.
end_timestampstringRequiredEnd of the time range, in Unix microseconds. This boundary is inclusive. The range cannot exceed 60 seconds.
limitintegerOptionalMaximum number of price records per page. The default is 100 and the maximum 1,000.
afterstringOptionalPagination token from the previous response's next field.
split_adjustedbooleanOptionalScale prices published before a stock split into post-split terms. Defaults to false.
Response
200 · application/jsonReturns a JSON object with the following fields.
dataobject[]Price records returned on this page.
channelintegerNumeric ID of the update channel.
channel_nameName of the update channel.
- real_time
- fixed_rate@50ms
- fixed_rate@200ms
- fixed_rate@1000ms
price_feed_idintegerNumeric ID of the price feed.
publish_timeintegerPublication timestamp of the update, in Unix microseconds.
confidenceinteger | nullConfidence interval of the price, before applying exponent.
exponentinteger | nullPower of ten that scales the decimal fields: decimal value = mantissa * 10^exponent.
market_sessionstring | nullMarket session of the feed update.
- regular
- preMarket
- postMarket
- overNight
- closed
priceinteger | nullPrice, before applying exponent. On funding-rate feeds, the funding price.
Show 9 moreShow fewer
best_ask_priceinteger | nullBest ask price, before applying exponent.
best_bid_priceinteger | nullBest bid price, before applying exponent.
ema_confidenceinteger | nullExponential moving average of the confidence interval, before applying exponent.
ema_priceinteger | nullExponential moving average of the price, before applying exponent.
feed_update_timestampinteger | nullFeed update timestamp, in Unix microseconds.
funding_rateinteger | nullPerpetual futures funding rate, before applying exponent.
funding_rate_intervalinteger | nullTime between funding rate updates, in microseconds.
funding_timestampinteger | nullTimestamp of the latest funding rate, in Unix microseconds.
publisher_countinteger | nullNumber of publishers contributing to the update.
nextstring | nullToken to pass as after when requesting the next page. Omitted when no further page is available.
Status codes returned when a request fails.
- 400
- The query parameters are invalid or a requested price feed is unavailable on this channel.
- 401
- Authentication is missing.
- 403
- The credentials do not grant access to a requested price feed.
- 404
- The requested price feed was not found.