get_source#

FredAPI.get_source(source_id, realtime_start=None, realtime_end=None)[source]#

Get a FRED source

Retrieves information about a source from the FRED API.

Parameters:
  • source_id (int) – The ID for the source.

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

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

Returns:

If multiple sources are returned.

Return type:

List[Source]

Raises:

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

Example

>>> import fedfred as fd
>>> fred = fd.FredAPI('your_api_key')
>>> source = fred.get_source(1)
>>> print(source[0].name)
'Board of Governors of the Federal Reserve System'
FRED API Documentation:

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