get_category_related#
- async AsyncAPI.get_category_related(category_id, realtime_start=None, realtime_end=None)#
Get a FRED Category’s Related Categories
Get related categories for a given category ID from the FRED API.
- Parameters:
- 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 = FredAPI('your_api_key').Async >>> related = await fred.get_category_related(32073) >>> for category in related: >>> print(category.name) >>> asyncio.run(main()) 'Arkansas' 'Illinois' 'Indiana' 'Kentucky' 'Mississippi' 'Missouri' 'Tennessee'
- FRED API Documentation:
https://fred.stlouisfed.org/docs/api/fred/category_related.html