The price endpoint allows users to query the price history of a cryptocurrency based on a specified epoch timestamp (in seconds). The system will find the nearest available price point to the provided timestamp, selecting from data aggregated by minute, hour, or day. The granularity of the returned data depends on how far back in time the requested timestamp is.
https://api.coinranking.com/v2/coin/:uuid/price
Parameter | Description |
---|---|
uuid String | UUID of the coin you need the price. |
Parameter | Description |
---|---|
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: yhjMzLPhuIDlExample:
...coin/Qwsogvtv82FCd/price?referenceCurrencyUuid=5k-_VTxqtCEI
|
timestamp (optional) Number |
The timestamp parameter accepts an epoch timestamp in seconds. This timestamp is used to find the nearest available price point, selecting the data's granularity based on the age of the request:
If no timestamp is provided, this endpoint will default to the latest price. Example:
...coin/Qwsogvtv82FCd/price?timestamp=1588349307
|
jsonHTTP/1.1 200 OK
{
"status": "success",
"data": {
"price": "7305.985182338483",
"timestamp": 1586305740
}
}
Property | Description |
---|---|
status String | Status of the request Allowed values:success |
data Object | |
data.price String | The price of the requested coin at the requested time |
data.timestamp Number | An Epoch timestamp in seconds when the coin had the given price. Might differ from the provided timestamp in the request, because it is stripped down to the day, hour or minute. |
jsonHTTP/1.1 404 Not Found
{
"status": "fail",
"type": "COIN_NOT_FOUND",
"message": "Coin not found"
}