0
# Currency and Forex
1
2
Foreign exchange data including currency pairs, exchange rates, and forex market information. The currency module provides access to FX market data and currency analytics.
3
4
## Capabilities
5
6
### Foreign Exchange Data
7
8
Comprehensive forex market data including currency pairs, exchange rates, and FX market analytics.
9
10
```python { .api }
11
def obb.currency.reference_rates(
12
provider: str = None,
13
**kwargs
14
) -> ResponseObject:
15
"""
16
Get currency reference rates.
17
18
Parameters:
19
- provider: Data provider to use
20
21
Returns:
22
ResponseObject with currency reference rates
23
"""
24
25
def obb.currency.search(
26
query: str,
27
provider: str = None,
28
**kwargs
29
) -> ResponseObject:
30
"""
31
Search for currency pairs and related information.
32
33
Parameters:
34
- query: Search term for currency pairs
35
- provider: Data provider to use
36
37
Returns:
38
ResponseObject with matching currency pairs
39
"""
40
41
def obb.currency.snapshots(
42
provider: str = None,
43
**kwargs
44
) -> ResponseObject:
45
"""
46
Get currency market snapshots.
47
48
Parameters:
49
- provider: Data provider to use
50
51
Returns:
52
ResponseObject with currency market snapshots
53
"""
54
55
def obb.currency.historical(
56
symbol: str,
57
provider: str = None,
58
**kwargs
59
) -> ResponseObject:
60
"""
61
Get historical currency data.
62
63
Parameters:
64
- symbol: Currency pair symbol (e.g., "EUR/USD")
65
- provider: Data provider to use
66
67
Returns:
68
ResponseObject with historical currency data
69
"""
70
```
71
72
## Usage Examples
73
74
### Basic Forex Data
75
76
```python
77
from openbb import obb
78
79
# Get currency reference rates
80
rates_data = obb.currency.reference_rates()
81
rates_df = rates_data.to_dataframe()
82
83
# Search for currency pairs
84
search_data = obb.currency.search(query="EUR")
85
search_df = search_data.to_dataframe()
86
87
# Get historical currency data
88
historical_data = obb.currency.historical(symbol="EUR/USD")
89
historical_df = historical_data.to_dataframe()
90
```
91
92
### Currency Analysis Workflow
93
94
```python
95
# Retrieve currency pair data
96
# Analyze exchange rate trends
97
# Compare multiple currency pairs
98
```