Get API key

Get OHLC history

gethttps://pyth.dourolabs.app/v1/{channel}/history

An API key or short-lived access token, in an Authorization: Bearer <token> header.

Returns open, high, low, and close (OHLC) price bars for a symbol in TradingView's Universal Data Feed (UDF) format. Specify the time range using Unix timestamps in seconds. If the range contains no data, the response arrays are empty.

getv1/{channel}/history
curl "https://pyth.dourolabs.app/v1/real_time/history?symbol=Crypto.BTC%2FUSD&from=1758826800&to=1758830400&resolution=60" \
  -H "Authorization: Bearer $PYTH_API_KEY"
Response
{
  "s": "ok",
  "c": [100, 101],
  "h": [101, 102],
  "l": [99, 100],
  "o": [99, 100],
  "t": [1684137600, 1684137660],
  "v": [0, 0]
}

Path parameters

Replace the placeholders in the URL path with these values.

channelRequired

The channel that determines the update frequency.

Query parameters

Add these parameters to the URL query string.

symbolstringRequired

Symbol name or ticker. Matching is case-insensitive.

fromstringRequired

Start of the requested range, in Unix seconds. This boundary is inclusive.

tostringRequired

End of the requested range, in Unix seconds. This boundary is inclusive. Future timestamps return data through the latest available bar.

resolutionstringRequired

Bar length: a whole number of minutes, such as 1, 60 or 240. Also D/1D for a day, W/1W for a week and M/1M for a month. Letters are case-sensitive.

split_adjustedbooleanOptional

Scale prices published before a stock split into post-split terms. Defaults to false.

Response

200 · application/json

Returns a JSON object with the following fields.

sstring

Response status: ok or error.

  • ok
  • error
cnumber[] | null

Closing price of each bar.

errmsgstring | null

Error description, when present.

hnumber[] | null

Highest price of each bar.

lnumber[] | null

Lowest price of each bar.

onumber[] | null

Opening price of each bar.

tinteger[] | null

Bar timestamps, in Unix seconds. Values at the same array index describe the same bar.

vinteger[] | null

Volume for each bar. This endpoint returns zero for each bar.

Errors

Status codes returned when a request fails.

400
The requested channel is invalid.
401
Authentication is missing. The body is the plain text "Unauthorized", so TradingView's UDF adapter reports a JSON parse error.
403
The credentials do not grant access to the requested symbol.
404
The symbol does not exist, is not on this channel, or is not visible to these credentials.
429
The request rate limit for this API key was exceeded.