Skip to main content
Version: v5

cpi

Consumer Price Index (CPI) data from the IMF.

Examples​

from openbb import obb
# Latest CPI basket weightings reported by the IMF.
obb.imf.cpi(provider='imf', country='CAN', transform='weight_percent', expenditure='all', limit=1)

Parameters​

country: str | None | list[str | None]
Default: united_states
The country to get data. Multiple items allowed for provider(s): imf.

transform: str | None
Default: yoy
Transformation of the CPI data.

Choices
  • index
  • period
  • yoy
  • ref_index
  • ref_period
  • ref_yoy
  • weight
  • weight_percent

frequency: str | None
Default: monthly
The frequency of the data.

harmonized: bool | None
Default: False
If true, returns harmonized data.

start_date: date | None | str
Start date of the data, in YYYY-MM-DD format.

end_date: date | None | str
End date of the data, in YYYY-MM-DD format.


Returns​

results: ImfConsumerPriceIndex

Serializable results.

provider: str | None

Provider name.

warnings: Optional[list[Warning_]]

List of warnings.

chart: Optional[Chart]

Chart object.

extra: dict[str, Any]

Extra info.


Data​

date: date | str
The date of the data.

country: str
None

value: float
CPI index value or period change.