yield_curve
Get yield curve data by country and date.
Examples
from openbb import obb
obb.fixedincome.government.yield_curve(provider='federal_reserve')
obb.fixedincome.government.yield_curve(date='2023-05-01,2024-05-01', provider='fmp')
obb.fixedincome.government.yield_curve(date='2023-05-01', country=united_kingdom, provider='econdb')
obb.fixedincome.government.yield_curve(provider='ecb', yield_curve_type=par_yield)
obb.fixedincome.government.yield_curve(provider='fred', yield_curve_type=real, date='2023-05-01,2024-05-01')
Parameters
- standard
- ecb
- econdb
- federal_reserve
- fmp
- fred
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
rating: Literal['aaa', 'all_ratings']
Default: aaa
The rating type, either 'aaa' or 'all_ratings'.
yield_curve_type: Literal['spot_rate', 'instantaneous_forward', 'par_yield']
Default: spot_rate
The yield curve type.
use_cache: bool
Default: True
If true, cache the request for four hours.
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
country: str | list[str]
Default: united_states
The country to get data. New Zealand, Mexico, Singapore, and Thailand have only monthly data. The nearest date to the requested one will be used. Multiple items allowed for provider(s): econdb.
Choices
- australia
- canada
- china
- ecb_instantaneous_forward
- ecb_par_yield
- ecb_spot_rate
- hong_kong
- india
- japan
- mexico
- new_zealand
- russia
- saudi_arabia
- singapore
- south_africa
- south_korea
- taiwan
- thailand
- united_kingdom
- united_states
use_cache: bool
Default: True
If true, cache the request for four hours.
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
date: Union[date | str, list[date | str]]
A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): ecb, econdb, federal_reserve, fmp, fred.
yield_curve_type: Literal['nominal', 'real', 'breakeven', 'treasury_minus_fed_funds', 'corporate_spot', 'corporate_par']
Default: nominal
Yield curve type. Nominal and Real Rates are available daily, others are monthly. The closest date to the requested date will be returned.
Returns
results: list[YieldCurve]
Serializable results.
provider: Optional[Literal['ecb', 'econdb', 'federal_reserve', 'fmp', 'fred']]
Provider name.
warnings: Optional[list[Warning_]]
list of warnings.
chart: Optional[Chart]
Chart object.
extra: dict[str, Any]
Extra info.
Data
- standard
- ecb
- econdb
- federal_reserve
- fmp
- fred
date: date | str
The date of the data.
maturity: str
Maturity length of the security.
date: date | str
The date of the data.
maturity: str
Maturity length of the security.
date: date | str
The date of the data.
maturity: str
Maturity length of the security.
date: date | str
The date of the data.
maturity: str
Maturity length of the security.
date: date | str
The date of the data.
maturity: str
Maturity length of the security.
date: date | str
The date of the data.
maturity: str
Maturity length of the security.