Skip to content

tags module

The tags module provides functions to request data from the FRED API Tags endpoints.

FRED tags are assigned to series. Tags define a characteristic about the series. Each tag is a unique character identifier. For example:

  • Gross Domestic Product has the tag id 'gdp'
  • Not Seasonally Adjusted has the tag id 'nsa'
  • Monthly has the tag id monthly

Categories are organized in a hierarchical structure where parent categories contain children categories. All categories are children of the root category (category_id = 0).

TagsApiParameters

Bases: BaseModel

Represents the parameters accepted by the FRED Tags endpoints.

get_related_tags(tag_names: str, api_key: ApiKeyType = None, **kwargs: KwargsType) -> JsonType

Get related FRED tags for one or more FRED tags. Endpoint documentation.

Parameters:

Name Type Description Default
tag_names str

A semicolon delimited list of tag names that series match all of.

required
api_key str | None

FRED API key. Defaults to None. If None, will search for FRED_API_KEY in the environment.

None
**kwargs dict

Additional parameters to FRED API related_tags/ endpoint. Refer to the FRED documentation for a list of all possible parameters.

{}

Returns:

Type Description
dict

A dictionary representing the json response.

get_series_matching_tags

get_series_matching_tags(tag_names: str, api_key: ApiKeyType = None, **kwargs: KwargsType) -> JsonType

Get the series matching all tags in the tag_names parameter. Endpoint documentation.

Parameters:

Name Type Description Default
tag_names str

A semicolon delimited list of tag names that series match all of.

required
api_key str | None

FRED API key. Defaults to None. If None, will search for FRED_API_KEY in environment variables.

None
**kwargs dict

Additional parameters to FRED API tags/series endpoint. Refer to the FRED documentation for a list of all possible parameters.

{}

Returns:

Type Description
dict

A dictionary representing the json response.

get_tags

get_tags(api_key: ApiKeyType = None, **kwargs: KwargsType) -> JsonType

Get FRED tags.Endpoint documentation.

Parameters:

Name Type Description Default
api_key str | None

FRED API key. Defaults to None. If None, will search for FRED_API_KEY in environment variables.

None
**kwargs dict

Additional parameters to FRED API tags/ endpoint. Refer to the FRED documentation for a list of all possible parameters.

{}

Returns:

Type Description
dict

A dictionary representing the json response.