get_sources#
- FredAPI.get_sources(realtime_start=None, realtime_end=None, limit=None, offset=None, order_by=None, sort_order=None)[source]#
Get FRED sources
Retrieve sources of economic data from the FRED API.
- Parameters:
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.
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).
- 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 >>> fred = fd.FredAPI('your_api_key') >>> sources = fred.get_sources() >>> for source in sources: >>> print(source.name) 'Board of Governors of the Federal Reserve System' 'Federal Reserve Bank of Philadelphia' 'Federal Reserve Bank of St. Louis'...
- FRED API Documentation: