get_series#

FredAPI.get_series(series_id, realtime_start=None, realtime_end=None)[source]#

Get a FRED series

Retrieve economic data series information from the FRED API.

Parameters:
  • series_id (str) – The ID for the economic data 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 series are returned.

Return type:

List[Series]

Raises:

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

Example

>>> import fedfred as fd
>>> fred = fd.FredAPI('your_api_key')
>>> series = fred.get_series('GNPCA')
>>> print(series[0].title)
'Real Gross National Product'
FRED API Documentation:

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