Overview
The coincap interface in Tushare provides daily market capitalization data for digital currencies, updated every 6 hours. This dataset includes multiple entries per day for each cryptocurrency, allowing users to filter or aggregate data as needed.
Key Features
โ
Real-time updates: Data refreshed every 6 hours.
โ
Multi-currency support: Includes major cryptocurrencies like BTC, ETH, QTUM, and more.
โ
Comprehensive metrics: Market cap, price, 24-hour volume, circulating supply, and timestamps.
Input Parameters
| Parameter | Type | Required | Description |
|---------------|--------|----------|--------------------------------------|
| trade_date | str | Yes | Date (format: YYYYMMDD) |
| coin | str | No | Cryptocurrency code (e.g., BTC) |
Output Parameters
| Field | Type | Description |
|----------------|---------|------------------------------------------|
| trade_date | str | Transaction date (YYYYMMDD) |
| coin | str | Cryptocurrency code (e.g., BTC) |
| name | str | Full currency name (e.g., Bitcoin) |
| marketcap | str | Market cap (in USD) |
| price | float | Current price (USD) |
| vol24 | float | 24-hour trading volume (USD) |
| supply | float | Circulating supply |
| create_time | str | Data collection timestamp |
How to Use
Method 1: Fetch All Data for a Date
pro = ts.pro_api()
df = pro.coincap(trade_date='20180806') Method 2: Filter by Cryptocurrency
df = pro.query('coincap', trade_date='20180806', coin='BTC') ๐ Explore Tushare API documentation for advanced queries.
Sample Data
| trade_date | coin | name | marketcap | price | vol24 | supply | create_time |
|------------|------|----------|-----------------|---------|-------------|------------|----------------------|
| 20180806 | BTC | Bitcoin | 1.232036e+11 | 7192.94 | 1.719e+07 | 17.11M | 2018-08-06 11:10:28 |
| 20180806 | ETH | Ethereum | 4.184291e+10 | 407.21 | 1.011e+08 | 102.74M | 2018-08-06 11:10:28 |
FAQs
1. How often is the data updated?
Data is collected every 6 hours, so each cryptocurrency may have multiple entries per day.
2. Can I retrieve historical data?
Yes, specify the trade_date parameter for past dates.
3. What currencies are supported?
Major cryptocurrencies like BTC, ETH, XRP, and others are included.
4. How do I filter for a specific coin?
Use the coin parameter (e.g., coin='BTC').
๐ Learn more about Tushare integrations for custom solutions.
Conclusion
The coincap interface is ideal for tracking real-time cryptocurrency trends, portfolio analysis, and market research. For optimal results, combine with other Tushare APIs like daily pricing or exchange rates.
Need help? Check our developer resources for tutorials and support.