0
# Cryptocurrency Data
1
2
Cryptocurrency market data including historical prices, market information, and trading pair discovery across major exchanges. The crypto module provides unified access to cryptocurrency data from multiple sources and exchanges.
3
4
## Capabilities
5
6
### Price Data
7
8
Historical and real-time cryptocurrency price data including OHLCV data across major trading pairs.
9
10
```python { .api }
11
def obb.crypto.price.historical(
12
symbol: str,
13
start_date: str = None,
14
end_date: str = None,
15
interval: str = "1d",
16
provider: str = None,
17
**kwargs
18
) -> ResponseObject:
19
"""
20
Get historical cryptocurrency price data.
21
22
Parameters:
23
- symbol: Cryptocurrency trading pair (e.g., "BTC-USD", "ETH-BTC")
24
- start_date: Start date in YYYY-MM-DD format
25
- end_date: End date in YYYY-MM-DD format
26
- interval: Data interval ("1m", "5m", "15m", "30m", "1h", "1d", "1wk", "1mo")
27
- provider: Data provider to use
28
29
Returns:
30
ResponseObject with historical crypto price data including open, high, low, close, volume
31
"""
32
```
33
34
### Cryptocurrency Search and Discovery
35
36
Tools for discovering cryptocurrency trading pairs and market information.
37
38
```python { .api }
39
def obb.crypto.search(
40
query: str,
41
provider: str = None,
42
**kwargs
43
) -> ResponseObject:
44
"""
45
Search for cryptocurrency trading pairs.
46
47
Parameters:
48
- query: Search term (cryptocurrency name or symbol like "BTC", "Bitcoin")
49
- provider: Data provider to use
50
51
Returns:
52
ResponseObject with matching cryptocurrency pairs and their symbols
53
"""
54
```
55
56
## Usage Examples
57
58
### Basic Cryptocurrency Data
59
60
```python
61
from openbb import obb
62
63
# Get Bitcoin historical data
64
btc_data = obb.crypto.price.historical(
65
symbol="BTC-USD",
66
start_date="2024-01-01",
67
end_date="2024-12-31"
68
)
69
btc_df = btc_data.to_dataframe()
70
71
# Get Ethereum data
72
eth_data = obb.crypto.price.historical("ETH-USD")
73
eth_df = eth_data.to_dataframe()
74
```
75
76
### Cryptocurrency Discovery
77
78
```python
79
# Search for Bitcoin-related pairs
80
btc_pairs = obb.crypto.search("BTC")
81
pairs_df = btc_pairs.to_dataframe()
82
83
# Search for specific cryptocurrency
84
ethereum_info = obb.crypto.search("Ethereum")
85
eth_info_df = ethereum_info.to_dataframe()
86
```
87
88
### Multi-Exchange Data Access
89
90
```python
91
# Access cryptocurrency data from different providers/exchanges
92
# Provider-specific features while maintaining consistent interface
93
crypto_data = obb.crypto.price.historical(
94
symbol="BTC-USD",
95
provider="polygon" # or other supported crypto data providers
96
)
97
```