Skip to main content

cpi

Get Consumer Price Index (CPI).

Returns either the rescaled index value, or a rate of change (inflation).

Parameters

country: Union[str, list[str]]

The country to get data. Multiple items allowed for provider(s): fred, oecd.

Default: united_states

Optional: True


transform: Literal['index', 'yoy', 'period']

Transformation of the CPI data. Period represents the change since previous. Defaults to change from one year ago (yoy).

Default: yoy

Optional: True


frequency: Literal['annual', 'quarter', 'monthly']

The frequency of the data.

Default: monthly

Optional: True


harmonized: bool

If true, returns harmonized data.

Default: False

Optional: True


start_date: Union[date, str]

Start date of the data, in YYYY-MM-DD format.

Optional: True


end_date: Union[date, str]

End date of the data, in YYYY-MM-DD format.

Optional: True


Returns

results: list[ConsumerPriceIndex]

Serializable results.


provider: Optional[Literal['fred', 'oecd']]

Provider name.


warnings: Optional[list[Warning_]]

list of warnings.


chart: Optional[Chart]

Chart object.


extra: dict[str, Any]

Extra info.


Data

date: Union[date, str]

The date of the data.

country: str

None

value: float

CPI index value or period change.