Discrepancy in Timestamp-Based Price Data from Coinranking API

Hi,

I am experiencing an issue when using the Coinranking API. When making a request to get the price of a cryptocurrency using a specific timestamp, I am not receiving the expected data.

Issue Details:
Endpoint Used: https://api.coinranking.com/v2/coin/razxDUgYGNAdQ/price
Timestamp Parameter: 1658808000
Response Received:

{
“status”: “success”,
“data”: {
“price”: “1440.0094454524867”,
“timestamp”: 1658793600
}
}

Observed Inconsistency: The timestamp in the response (1658793600) does not match the requested timestamp (1658808000). This results in a several-hour difference, affecting the accuracy of the data received.

Could you please provide any clarification or suggestion to address this issue? Is this a known limitation of the API, or is there an error in my request?

Thank you in advance for your help.

1 Like

Hi smicroz!

The price endpoint finds the closest timestamp there is for a price point:

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.

And I understand that is confusing. We do this for performance reasons, we do not have timestamps available for every timestamp. Our data is organized like this:

  • For the last 24 hours, we have data available for every minute.
  • Within 30 days we have datapoints for every hour
  • Data older than 30 days, and the timestamps are going to be truncated to a day.

We’ll make sure to update the docs to make this more clear!

1 Like