get_sources#

async AsyncAPI.get_sources(realtime_start=None, realtime_end=None, limit=None, offset=None, order_by=None, sort_order=None)#

Get FRED sources

Retrieve sources of economic data from the FRED API.

Parameters:
  • realtime_start (str, optional) – The start of the real-time period. Format: YYYY-MM-DD.

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

  • limit (int, optional) – The maximum number of results to return. Default is 1000, maximum is 1000.

  • offset (int, optional) – The offset for the results. Used for pagination.

  • order_by (str, optional) – Order results by values. Options are ‘source_id’, ‘name’, ‘realtime_start’, ‘realtime_end’.

  • sort_order (str, optional) – Sort order of results. Options are ‘asc’ (ascending) or ‘desc’ (descending).

  • file_type (str, optional) – The format of the returned data. Default is ‘json’. Options are ‘json’, ‘xml’.

Returns:

If multiple sources are returned.

Return type:

List[Source]

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
>>>     sources = await fred.get_sources()
>>>     for source in sources:
>>>         print(source.name)
>>> asyncio.run(main())
'Board of Governors of the Federal Reserve System'
'Federal Reserve Bank of Philadelphia'
'Federal Reserve Bank of St. Louis'...
FRED API Documentation:

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