{"id":109,"library":"sec-edgar-api","title":"SEC EDGAR API","description":"Python wrapper for the SEC EDGAR REST API providing access to company filings, submissions, and financial data from the U.S. Securities and Exchange Commission. Supports querying company facts, submissions, and XBRL companion data without requiring API keys.","status":"active","version":"0.1.7","language":"python","source_language":"en","source_url":"https://github.com/jadchaar/sec-edgar-api","tags":["sec","edgar","finance","filings","xbrl","python","api-wrapper"],"install":[{"cmd":"pip install sec-edgar-api","lang":"bash","label":"Python"}],"dependencies":[{"reason":"Core HTTP client used for all SEC EDGAR API requests.","package":"requests","optional":false}],"imports":[{"note":"The main client class is EdgarClient, not SECEdgarAPI or similar names.","wrong":"from sec_edgar_api import SECEdgarAPI","symbol":"EdgarClient","correct":"from sec_edgar_api import EdgarClient"}],"quickstart":{"code":"from sec_edgar_api import EdgarClient\n\n# SEC EDGAR requires a User-Agent header identifying the caller\nclient = EdgarClient(user_agent=\"MyCompany admin@mycompany.com\")\n\n# Get submissions for Apple (CIK 0000320193)\nsubmissions = client.get_submissions(cik=\"0000320193\")\nprint(submissions[\"name\"])\nprint(submissions[\"cik\"])\n\n# Get company facts (XBRL data)\nfacts = client.get_company_facts(cik=\"0000320193\")\nprint(list(facts[\"facts\"].keys()))","lang":"python","description":"Fetch SEC EDGAR submissions and company facts for Apple Inc."},"warnings":[{"fix":"Always pass user_agent='YourName yourname@example.com' when creating EdgarClient.","message":"SEC EDGAR requires a valid User-Agent header with company name and contact email. Requests without it are blocked with 403 errors.","severity":"breaking","affected_versions":"all"},{"fix":"Zero-pad CIK strings: cik = str(cik).zfill(10)","message":"CIK numbers must be zero-padded to 10 digits for some endpoints. Passing an unpadded CIK may result in 404 errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Add delays between requests with time.sleep(0.1) or use a rate limiter.","message":"SEC EDGAR enforces rate limiting at 10 requests per second. Exceeding this results in temporary IP blocks.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from sec_edgar_api import EdgarClient' after installing with 'pip install sec-edgar-api'.","message":"The package import uses underscores (sec_edgar_api) while the pip install name uses hyphens (sec-edgar-api).","severity":"gotcha","affected_versions":"all"},{"fix":"Inspect response dicts carefully and handle missing keys defensively with .get().","message":"Returned data is raw JSON from SEC EDGAR as Python dicts. There are no typed models or dataclass wrappers. Key names follow SEC conventions and may be inconsistent.","severity":"gotcha","affected_versions":"all"},{"fix":"Use a Python version between 3.8 and 3.12, or check for an updated version of the `sec-edgar-api` library that explicitly supports Python 3.13.","message":"The `sec-edgar-api` library is incompatible with Python 3.13, resulting in a `TypeError: Limiter.__init__() got an unexpected keyword argument 'raise_when_fail'`. This indicates a mismatch between the library's internal rate limiter implementation and its dependencies or the Python version.","severity":"breaking","affected_versions":"python:3.13"}],"env_vars":null,"last_verified":"2026-05-12T08:09:57.050Z","next_check":"2026-06-17T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install sec-edgar-api` and ensure the import statement is `from sec_edgar_api import SecEdgarApi`.","cause":"The 'sec-edgar-api' library is either not installed in the current Python environment or there is a typo in the import statement.","error":"ModuleNotFoundError: No module named 'sec_edgar_api'"},{"fix":"Always check if the result of an API call is not `None` before attempting to access its contents, for example: `data = api.get_submissions('AAPL'); if data: print(data['entityRegistrant']['cik'])`.","cause":"An API call method (e.g., `get_submissions`, `get_company_facts`) returned `None` due to a network error, invalid CIK/ticker, or an issue with the SEC EDGAR API, and the code subsequently tried to access it as if it were a dictionary or list.","error":"TypeError: 'NoneType' object is not subscriptable"},{"fix":"Use the `.get()` method with a default value, or check for the key's existence using `if 'key' in data_dict:` before attempting to access it, for example: `cik = data.get('entityRegistrant', {}).get('cik')`.","cause":"The API response, which is parsed into a Python dictionary, does not contain the specific key being accessed, possibly because the data structure varies between filings or the key name is misspelled.","error":"KeyError: 'some_missing_key'"},{"fix":"Import the `SecEdgarApi` class and then create an instance of it before calling its methods: `from sec_edgar_api import SecEdgarApi; api = SecEdgarApi(); submissions = api.get_submissions('AAPL')`.","cause":"The code attempted to call the `sec_edgar_api` module directly as a function instead of importing and instantiating the `SecEdgarApi` class from within it.","error":"TypeError: 'module' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.74,"mem_mb":14.6,"disk_size":"20.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.69,"mem_mb":14.6,"disk_size":"21M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}