__init__#
- FredAPI.__init__(api_key=None, cache_mode=False, cache_size=256)[source]#
Initialize the FredAPI class that provides functions which query FRED data.
- Parameters:
- Returns:
An instance of the FredAPI class.
- Return type:
- Raises:
RuntimeError – If no API key can be resolved from the explicit argument, global setting, or environment variable.
Example
>>> import fedfred as fd >>> fd.set_api_key("your_api_key") # optional global >>> fred = fd.FredAPI() # uses global/env key
Or explicitly:
>>> fred = fd.FredAPI(api_key="your_api_key")