Unlock Historical Cryptocurrency Data with Python
In today’s fast-evolving digital asset landscape, access to accurate and structured historical cryptocurrency data is essential for traders, analysts, and developers alike. Whether you're building predictive models, conducting backtesting strategies, or analyzing market trends, having reliable time-series data can make all the difference. Enter Historic-Crypto, a powerful open-source Python library designed to simplify the process of retrieving historical and live cryptocurrency market data from the CoinBase Pro API.
This lightweight yet feature-rich tool allows users to seamlessly interact with real-time and past trading data using familiar tools like Pandas DataFrames—making integration into existing data workflows effortless.
👉 Discover how to leverage real-time crypto insights using advanced data tools.
What Is Historic-Crypto?
Historic-Crypto is an open-source Python package that enables developers and data scientists to collect granular historical cryptocurrency pricing information directly from the CoinBase Pro API. It supports three core functionalities:
- List available cryptocurrency trading pairs
- Retrieve live bid/ask price data
- Fetch detailed historical candlestick data (Open, High, Low, Close, Volume) in a clean Pandas DataFrame format
Built for simplicity and efficiency, this library eliminates the complexity of manual API calls and JSON parsing, offering intuitive classes that return structured, analysis-ready datasets.
Core Features at a Glance
- Retrieve full trading history for any supported cryptocurrency pair
- Filter available coins using customizable search parameters
- Access real-time order book snapshots including bid, ask, and last trade details
- Export data directly into Pandas for immediate analysis or visualization
With support for multiple granularities (from 1-minute to daily intervals), Historic-Crypto is ideal for both short-term scalping strategies and long-term trend analysis.
Installation and Setup
Getting started with Historic-Crypto is straightforward if you have Python installed. Use pip to install the package:
pip install Historic-CryptoOnce installed, import the necessary modules:
from Historic_Crypto import HistoricalData
from Historic_Crypto import Cryptocurrencies
from Historic_Crypto import LiveCryptoDataNo API keys are required—this library interacts with CoinBase Pro’s public endpoints, making setup quick and secure.
Exploring Available Cryptocurrencies
Before fetching data, it's helpful to know which cryptocurrency pairs are available on the exchange. The Cryptocurrencies class makes this easy.
Basic Usage
from Historic_Crypto import Cryptocurrencies
# Retrieve all available trading pairs
data = Cryptocurrencies().find_crypto_pairs()
print(data.head())This returns a Pandas DataFrame with the following columns:
id: The ticker symbol used in other classes (e.g.,BTC-USD)display_name: Human-readable name (e.g., Bitcoin / USD)status: Trading status (e.g., "online")
Advanced Search Options
You can refine your search with optional parameters:
| Parameter | Description | Default |
|---|---|---|
coin_search | Filter by specific coin ID (string) | None |
extended_output | Show additional metadata (boolean) | False |
verbose | Print status messages during execution | True |
For example, to find all pairs involving Stellar (XLM):
data = Cryptocurrencies(coin_search='XLM', extended_output=False).find_crypto_pairs()This targeted search helps streamline workflows when working with specific assets.
👉 Start applying real-time market data in your own models today.
Fetching Historical Market Data
The primary use case for this library is retrieving historical price data. The HistoricalData class delivers OHLCV (Open, High, Low, Close, Volume) data at various time intervals.
How to Use HistoricalData
from Historic_Crypto import HistoricalData
# Fetch 5-minute candles for ETH-USD starting June 1, 2020
eth_data = HistoricalData(
ticker='ETH-USD',
granularity=300,
start_date='2020-06-01-00-00',
end_date='2020-06-02-00-00' # Optional; defaults to current time
).retrieve_data()Parameter Breakdown
| Argument | Description |
|---|---|
ticker | Trading pair (e.g., BTC-USD) |
granularity | Time interval in seconds: 60, 300, 900, 3600, 21600, 86400 |
start_date | Start time in format YYYY-MM-DD-HH-MM |
end_date | End time in same format (optional) |
verbose | Enable progress output |
Valid granularity values correspond to:
- 60 = 1 minute
- 300 = 5 minutes
- 900 = 15 minutes
- 3600 = 1 hour
- 21600 = 6 hours
- 86400 = 1 day
The result is a timestamp-indexed Pandas DataFrame—perfect for plotting price charts or feeding into machine learning pipelines.
Accessing Live Cryptocurrency Prices
For real-time monitoring or high-frequency analysis, the LiveCryptoData class provides instant access to current market conditions.
Example: Get Live ATOM/USD Data
from Historic_Crypto import LiveCryptoData
live_data = LiveCryptoData('ATOM-USD').return_data()
print(live_data)Returns a DataFrame containing:
price: Last traded pricesize: Trade size in base currencybid: Highest buy orderask: Lowest sell ordervolume: 24-hour trading volume- Indexed by timestamp
This is particularly useful for building dashboards or triggering alerts based on live price movements.
Parameters
| Argument | Description | Default |
|---|---|---|
ticker | Desired trading pair | Required |
verbose | Show progress output | True |
Use Cases and Applications
Historic-Crypto serves as a foundational tool across multiple domains:
Algorithmic Trading
Backtest trading strategies using precise historical OHLCV data across major cryptocurrencies.
Market Research & Analysis
Study volatility patterns, volume trends, and price cycles over time.
Educational Projects
Teach students about blockchain markets and financial data processing without complex infrastructure.
Portfolio Tracking
Combine live and historical data to monitor performance and risk exposure.
👉 Explore how professional-grade data fuels smarter investment decisions.
Frequently Asked Questions (FAQ)
Q: Do I need an API key to use Historic-Crypto?
A: No. This library uses CoinBase Pro’s public API endpoints, so no authentication or API keys are required.
Q: What is the oldest historical data available?
A: The CoinBase Pro API typically provides up to three years of historical data depending on the asset and granularity. For older records, consider combining with other archival sources.
Q: Can I retrieve data for multiple cryptocurrencies at once?
A: Not natively. You’ll need to loop through tickers using the HistoricalData class for each one. However, this approach integrates well with Pandas for batch processing.
Q: Is the data adjusted for splits or dividends?
A: Cryptocurrencies don’t issue dividends or undergo stock splits in the traditional sense. Therefore, no adjustments are needed. The data reflects actual traded prices.
Q: How often is live data updated?
A: The LiveCryptoData class fetches the most recent trade and quote snapshot at call time. For continuous updates, wrap it in a timed loop or event-driven system.
Q: Are there rate limits I should be aware of?
A: Yes. While Historic-Crypto doesn’t enforce limits itself, CoinBase Pro applies rate limiting on public APIs (typically around 3–6 requests per second). Avoid aggressive polling in production environments.
Final Thoughts
Historic-Crypto fills a critical gap for developers and analysts seeking clean, structured access to cryptocurrency market data. Its seamless integration with Pandas, minimal setup requirements, and clear class structure make it an excellent choice for anyone diving into crypto analytics.
Whether you're exploring Bitcoin’s price behavior during bull runs or building a real-time alert system for altcoins, this library provides the foundation you need—fast, free, and open-source.
As digital assets continue gaining mainstream traction, tools like Historic-Crypto empower individuals to make informed decisions backed by real data.