CBRAPI
cbrapi is a Python client for the Central Bank of Russia's web services.
Table of contents
CBRAPI main features
This client provides structured access to the following key data categories from the CBR:
- CURRENCY: Official exchange rates of foreign currencies against the Russian Ruble.
- METALS: Official prices of precious metals.
- RATES: Key interest rates and interbank lending rates.
- RESERVES: Data on international reserves and foreign currency liquidity.
- RUONIA: The Russian Overnight Index Average and related benchmark rates.
Installation
pip install cbrapi
The latest development version can be installed directly from GitHub:
git clone https://github.com/mbk-dev/cbrapi.git
cd cbrapi
poetry install
Core Functions
CURRENCY
Get a list of available currencies
Returns a list of all available currency tickers supported by the API.
get_currencies_list()
Get an internal CBR currency code for a ticker
Retrieves the internal CBR currency code for a given currency ticker.
get_currency_code(ticker: str)
Get currency rate historical data
Fetches historical exchange rate data for a specified currency and date range.
get_time_series(symbol: str, first_date: str, last_date: str, period: str = 'D')
METALS
Get precious metals prices time series
Provides historical prices for precious metals (Gold, Silver, Platinum, Palladium).
get_metals_prices(first_date: str | None = None, last_date: str | None = None, period: str = 'D')
RATES
IBOR: Interbank Offered Rate.
Get the key rate time series
Retrieves the historical key rate set by the Central Bank of Russia.
get_key_rate(first_date: str | None = None, last_date: str | None = None, period: str = 'D')
Get Interbank Offered Rate and related interbank rates
Fetches the historical Interbank Offered Rate and related interbank rates.
get_ibor(first_date: str | None = None, last_date: str | None = None, period: str = 'M')
RESERVES
MRRF: International Reserves and Foreign Currency Liquidity.
Get International Reserves and Foreign Currency Liquidity data
Provides time series data for International Reserves and Foreign Currency Liquidity.
get_mrrf(first_date: str | None = None, last_date: str | None = None, period: str = 'M')
RUONIA
- RUONIA: Russian Overnight Index Average.
- ROISfix: Russian Overnight Index Swap Fixing.
Get RUONIA time series data
Retrieves RUONIA time series data for a specific symbol.
get_ruonia_ts(symbol: str, first_date: str | None = None, last_date: str | None = None, period: str = 'D')
Get RUONIA index and averages time series
Fetches the historical RUONIA index and averages.
get_ruonia_index(first_date: str | None = None, last_date: str | None = None, period: str = 'D')
Get RUONIA overnight value time series
Provides the historical RUONIA overnight value.
get_ruonia_overnight(first_date: str | None = None, last_date: str | None = None, period: str = 'D')
Get ROISfix time series
Retrieves the historical ROISfix time series data.
get_roisfix(first_date: str | None = None, last_date: str | None = None, period: str = 'D')
Getting started
1. Monitor Central Bank's key rate daily changes
import cbrapi as cbr
cbr.get_key_rate("2017-09-13", "2023-09-13").head()
DATE
2017-09-12 9.0
2017-09-13 9.0
2017-09-14 9.0
2017-09-15 9.0
2017-09-16 9.0
Freq: D, Name: KEY_RATE, dtype: float64
2. Track precious metals market trends
cbr.get_metals_prices('2024-01-01', '2025-01-31').head()
| GOLD | SILVER | PLATINUM | PALLADIUM | |
|---|---|---|---|---|
| DATE | ||||
| 2024-01-09 | 5886.06 | 66.40 | 2755.41 | 2915.27 |
| 2024-01-10 | 5848.46 | 66.46 | 2701.63 | 2830.97 |
| 2024-01-11 | 5785.30 | 65.55 | 2654.59 | 2845.84 |
| 2024-01-12 | 5749.64 | 65.26 | 2618.17 | 2833.52 |
| 2024-01-13 | 5749.64 | 65.26 | 2618.17 | 2833.52 |
3. Monitor ROISfix daily pricing trends
cbr.get_roisfix().head()
| RATE_1_WEEK | RATE_2_WEEK | RATE_1_MONTH | RATE_2_MONTH | RATE_3_MONTH | RATE_6_MONTH | |
|---|---|---|---|---|---|---|
| DATE | ||||||
| 2011-04-14 | 3.09 | 3.09 | 3.18 | 3.24 | 3.32 | 3.51 |
| 2011-04-15 | 3.09 | 3.09 | 3.18 | 3.24 | 3.32 | 3.51 |
| 2011-04-16 | 3.09 | 3.09 | 3.18 | 3.24 | 3.32 | 3.51 |
| 2011-04-17 | 3.08 | 3.09 | 3.19 | 3.24 | 3.31 | 3.50 |
| 2011-04-18 | 3.08 | 3.09 | 3.19 | 3.24 | 3.31 | 3.49 |
License
MIT
Metadata
Release files for cbrapi 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cbrapi-0.3.1.tar.gz | 12.7 kB | Without provenance | Details for cbrapi-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cbrapi-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for cbrapi-0.3.1-py3-none-any.whl |
Total release size: 28.1 kB
Release files / cbrapi-0.3.1.tar.gz
| Download URL | cbrapi-0.3.1.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1239b1bbd986e5f192694a333e1882300a9530cb16cc7d787bfea75f80534db
|
|
BLAKE2b-256 checksum How to use checksums |
006ce47fdefba5041df797339440fe5a6e08aaedbd61763abad8bd39bd28ab30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Linux/6.18.40.1-microsoft-standard-WSL2
|
Release files / cbrapi-0.3.1-py3-none-any.whl
| Download URL | cbrapi-0.3.1-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52aef8ea1f8981000f28d0c7a34c9613597223c259c40d1c5582162ebdbca020
|
|
BLAKE2b-256 checksum How to use checksums |
8d800a0a9dbefd753f0190dd54ff67c983f3d59d9a0dfff6b9ea7b90abf61a9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Linux/6.18.40.1-microsoft-standard-WSL2
|
Security for cbrapi 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.