get_category#

async AsyncAPI.get_category(category_id)#

Get a FRED Category

Retrieve information about a specific category from the FRED API.

Parameters:

category_id (int) – The ID of the category to retrieve.

Returns:

If multiple categories are returned.

Return type:

List[Category]

Raises:

ValueError – If the response from the FRED API indicates an error.

Example

>>> import fedfred as fd
>>> import asyncio
>>> async def main():
>>>     fred = fd.FredAPI('your_api_key').Async
>>>     category = await fred.get_category(125)
>>>     for c in category:
>>>         print(category[0].name)
>>> asyncio.run(main())
'Trade Balance'
FRED API Documentation:

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