Coinranking keeps track of prices on all listed assets. The history endpoint lists prices and their timestamp for the requested time period, useful for making a chart.
On Coinranking, we use this endpoint for the main price chart on our coin detail page.
GET /coin/:uuid/history
https://api.coinranking.com/v2/coin/:uuid/history
Parameter | Description |
---|---|
uuid String | UUID of the coin you want to request |
Parameter | Description |
---|---|
timePeriod (optional) String |
Timeperiod where the change and history are based on Default value: 24hAllowed values: 1h 3h 12h 24h 7d 30d 3m 1y 3y 5y Example:
...coin/Qwsogvtv82FCd/history?timePeriod=1y
|
referenceCurrencyUuid (optional) String |
UUID of reference currency, in which all the prices are calculated. Defaults to US Dollar Default value: yhjMzLPhuIDlExample:
...coin/Qwsogvtv82FCd/history?referenceCurrencyUuid=5k-_VTxqtCEI
|
HTTP/1.1 200 OK
{
"status": "success",
"data": {
"change": "12",
"history": [
{
"price": "41905.99687434882803047615",
"timestamp": 1641897900
},
{
"price": "41937.93174219252237197408",
"timestamp": 1641897600
}
]
}
}
Property | Description |
---|---|
status String | Status of the request Allowed values:success |
data Object | |
data.change String | Percentage of change over the given time frame |
data.history Object[] | List of prices |
data.history.price String | Price of the coin |
data.history.timestamp Number | An Epoch timestamp in seconds when the coin had the given price. |
HTTP/1.1 404 Not Found
{
"status": "fail",
"type": "COIN_NOT_FOUND",
"message": "Coin not found"
}