> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://coingecko.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://coingecko.ferndocs.com/_mcp/server.

# 2. Get Historical Data

> **Check**
>
> ### **Tips**
>
> * Most of the historical data is returned and queried using UNIX Timestamp.
>   * If you are not familiar with UNIX Timestamp, you may use a tool like [epochconverter.com](https://www.epochconverter.com/) to convert between UNIX Timestamp and human readable date.
> * You may use either coin ID or contract address to get the historical data.

There are five different endpoints to get historical data of a coin:

| Endpoint                                                                                                                             | Description                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [/coins/\{id}/history](/api-reference/api-reference/coins/history/get)                                                               | Get the historical data (price, market cap, 24hrs volume, etc.) at a given date for a coin based on a particular coin ID.                                |
| [/coins/\{id}/market\_chart](/api-reference/api-reference/coins/market-chart/get)                                                    | Get the historical chart data of a coin including time in UNIX, price, market cap and 24hrs volume based on particular coin ID.                          |
| [/coins/\{id}/market\_chart/range](/api-reference/api-reference/coins/market-chart/get-range)                                        | Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hrs volume based on particular coin ID.     |
| [/coins/\{id}/contract/\{contract\_address}/market\_chart](/api-reference/api-reference/coins/contract/market-chart/get)             | Get the historical chart data of a coin including time in UNIX, price, market cap and 24hrs volume based on token contract address.                      |
| [/coins/\{id}/contract/\{contract\_address}/market\_chart/range](/api-reference/api-reference/coins/contract/market-chart/get-range) | Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hrs volume based on token contract address. |

> **Note**
>
> ### **Notes**
>
> The data granularity (interval) for [/market\_chart](/api-reference/api-reference/coins/market-chart/get) and [/market\_chart/range](/api-reference/api-reference/coins/market-chart/get-range) endpoints is automatic and based on the date range:
>
> * 1 day from current time = 5-minutely data
> * 1 day from anytime (except from current time) = hourly data
> * 2 - 90 days from current time or anytime = hourly data
> * above 90 days from current time or anytime = daily data (00:00 UTC)