__init__#

EdgarAPI.__init__(cache_mode=False, cache_size=256)[source]#

Initialize the EdgarAPI class the provide functions for accessing SEC EDGAR data.

Parameters:
  • cache_mode (bool) – Whether to enable caching for API responses. Defaults to False.

  • cache_size (int) – The maximum number of items to store in the cache if caching is enabled. Defaults to 256.

Returns:

An instance of the EdgarAPI class.

Return type:

EdgarAPI

Raises:

ValueError – If the cache_size parameter is not a positive integer.

Example

>>> import edgar_sec as ed
>>> api = ed.EdgarAPI(cache_mode=True)

Note

Unlike many APIs, the SEC EDGAR API doesn’t require an API key, but it does enforce a rate limit of 10 requests per second which this implementation automatically respects.