Introduction
Tracking historical cryptocurrency metrics is essential for market analysis, investment strategies, and portfolio management. CoinMarketCap's API provides a robust solution to retrieve past global market data, including market capitalization, Bitcoin dominance, and trading volume. Below is a step-by-step guide to using this API effectively.
API Endpoint Overview
The /v1/global-metrics/quotes/historical endpoint allows users to fetch historical global cryptocurrency metrics based on customizable parameters.
Key Features:
- Retrieve time-stamped market data (e.g., total market cap, 24-hour volume).
- Filter results by date range (
time_start,time_end) and intervals (1d,hourly,monthly). - Convert values into multiple fiat currencies or cryptocurrencies.
Parameters Explained
| Parameter | Description | Example |
|---|---|---|
time_start | Optional. Start timestamp (Unix or ISO 8601). | 2024-01-01T00:00:00Z |
time_end | Optional. End timestamp. | 2024-10-01T00:00:00Z |
interval | Time interval for data points (1d, hourly, weekly). | 1d |
count | Optional. Number of interval periods to return. | 100 |
convert | Calculate quotes in 3 additional currencies (e.g., USD, BTC). | convert=USD,EUR,BTC |
convert_id | Use CoinMarketCap IDs for conversions (e.g., 1 for Bitcoin). | convert_id=1,2781 |
Response Structure
The API returns a JSON object with:
quotes: Array of objects containing historical metrics.timestamp: Date and time of data.btc_dominance: Bitcoin’s market share (%).active_cryptocurrencies: Number of cryptocurrencies tracked.total_market_cap: Global market cap (USD).total_volume_24h: 24-hour trading volume (USD).
Example Response:
{
"data": {
"quotes": [
{
"timestamp": "2024-01-01T00:00:00.000Z",
"btc_dominance": 45.0057,
"active_cryptocurrencies": 2900,
"total_market_cap": 2374432083905.6846,
"total_volume_24h": 262906061281.24
}
]
},
"status": {
"timestamp": "2024-10-11T02:36:05.986Z",
"error_code": 0,
"error_message": null,
"elapsed": 10,
"credit_count": 1
}
}Subscription Plans
This API is available across multiple tiers, from Basic to Enterprise, with varying access periods (1 month to 6 years).
👉 Compare all plans and features here to choose the best fit for your needs.
FAQs
1. Can I retrieve hourly data for Bitcoin dominance?
Yes. Set interval=hourly and specify the time range in time_start/time_end.
2. How do I convert market cap to EUR?
Add convert=EUR in your request parameters.
3. Is there a limit to the number of data points returned?
Yes. Use the count parameter to cap results (e.g., count=100 returns 100 intervals).
4. Which plans support historical data?
All paid plans (Hobbyist to Enterprise) include historical data access.
5. How accurate is the historical data?
CoinMarketCap aggregates data from multiple exchanges, ensuring high reliability.
Conclusion
Leveraging CoinMarketCap’s historical data API empowers investors and analysts with actionable insights. For advanced tools, check out 👉 this platform to enhance your crypto research.