Get coin OHLC

professional This endpoint requires the professional plan or higher

Get OHLC (Open High Low Close) data for the coin throughout time.

https://api.coinranking.com/v2/coin/:uuid/ohlc

Path parameters

ParameterDescription
uuid StringUUID of the coin you want to request the OHLC data for.

Query parameters

Parameter Description
interval (optional) String

The interval determines the time period over which each OHLC item is determined.

Default value: day
Allowed values:
minute 5minutes hour 8hours day week month

Example:
...coin/Qwsogvtv82FCd/ohlc?interval=hour
limit (optional) Number

Limit. Limit the amount of time periods for which the OHLC data is retrieved. For example, when interval=hour and limit is 10, data will be returned for the last 10 hours. The maximum amount of results you can fetch in one request is 5000 for the Startup and Professional plan, and 100 for the Free plan.

Default value: 50
Size range: 0-5000


Example:
...coin/Qwsogvtv82FCd/ohlc?limit=10
referenceCurrencyUuid (optional) String

UUID of coin (either fiat or crypto), in which all the prices are calculated. Defaults to US Dollar, but you can use any coin. You can find UUIDs for reference currencies in any coin endpoint, including a convenient dedicated reference currency endpoint

Default value: yhjMzLPhuIDl

Example:
...coin/Qwsogvtv82FCd/ohlc?referenceCurrencyUuid=5k-_VTxqtCEI

Code examples

Response

json
HTTP/1.1 200 OK { "status": "success", "data": { "ohlc": [ { "startingAt": 1641427200, "open": "43639.170052896734", "high": "43830.15844443845", "low": "42679.105282492994", "close": "43253.82606224523", "avg": "43194.86335084649" }, { "startingAt": 1641340800, "open": "45997.97595190101", "high": "47050.58243007133", "low": "42923.375181467185", "close": "43639.198327313374", "avg": "46022.85506904964" } ] } }

Response fields

PropertyDescription
status String

Status of the request

Allowed values:
success
data Object
data.ohlc Object[]

List of OHLC items

data.ohlc.startingAt Number

An Epoch timestamp in seconds marking the start of the time period on which the OHLC values are based.

data.ohlc.open String/null

Opening price of the coin for the time period

data.ohlc.high String/null

Highest price of the coin during the time period

data.ohlc.low String/null

Lowest price of the coin during the time period

data.ohlc.close String/null

Closing price of the coin for the time period

data.ohlc.avg String/null

Average price of the coin over the time period

Error response

json
HTTP/1.1 404 Not Found { "status": "fail", "type": "COIN_NOT_FOUND", "message": "Coin not found" }

Error responses