get_series_categories#

async AsyncAPI.get_series_categories(series_id, realtime_start=None, realtime_end=None)#

Get FRED series categories

Get the categories for a specified series.

Parameters:
  • series_id (str) – The ID for the series.

  • realtime_start (str | datetime, optional) – The start of the real-time period. String format: YYYY-MM-DD.

  • realtime_end (str | datetime, optional) – The end of the real-time period. String format: YYYY-MM-DD.

Returns:

If multiple categories are returned.

Return type:

List[Category]

Raises:

ValueError – If the API request fails or returns an error.

Example

>>> import fedfred as fd
>>> import asyncio
>>> async def main():
>>>     fred = fd.FredAPI('your_api_key').Async
>>>     categories = await fred.get_series_categories('EXJPUS')
>>>     for category in categories:
>>>         print(category.id)
>>> asyncio.run(main())
95
275
FRED API Documentation:

https://fred.stlouisfed.org/docs/api/fred/series_categories.html