Download SEC EDGAR filings by quarter/year via master index.
Project description
secfetcher
Grab SEC EDGAR filings in bulk — by quarter or by year, straight from the official master index. Pick your forms and file types; skip the rest.
📖 Docs
| Where | What you get |
|---|---|
| 📄 Full documentation | Install, quickstart, CLI, form allowlist, API reference — all in one place. |
| docs/index.html | Open locally in your browser. |
Install
Requires Python 3.10+.
pip install secfetcher
Using a venv (recommended):
python -m venv .venv
. .venv/bin/activate # Windows: .venv\Scripts\activate
pip install secfetcher
PyPI package: secfetcher · Import / CLI: secfetch or secfetcher
Quick start
Python
from secfetcher import download_quarter, download_year
# One quarter
download_quarter(
year=2024,
quarter=3,
forms=["10-Q", "10-K"],
data_dir="data",
file_types=[".xml", ".htm", ".html", ".pdf"],
)
# Full year
download_year(year=2024, forms=["8-K"], data_dir="data", file_types=[".htm", ".html"])
CLI
secfetch quarter --year 2024 --quarter 3 --forms 10-Q 10-K --data-dir data --file-types .xml .htm .html .pdf
secfetch year --year 2024 --forms 8-K --data-dir data --file-types .htm .html
python -m secfetch --help
SEC User-Agent
The SEC requires a User-Agent with your contact info. Set it once:
export SEC_USER_AGENT="Your Name or Company contact@example.com"
You can also pass user_agent in code or via the CLI.
Form types
Only allowlisted SEC form types are accepted (e.g. 10-Q, 10-K, 8-K). The list is in data/config/form_types.json (created on first run) — edit it to add or remove types. See the full list in the docs →
Where files go
Downloads are grouped by year and quarter:
data/
index/master/<year>/QTR<n>/ ← master index cache
filings/<year>/QTR<q>/<form>/<cik>/<accession>/ ← your downloads
_state/manifest.json
Resume vs redownload
If you run again for the same year/quarter, secfetch will detect existing data. You can:
- Resume (default) — skip filings already downloaded; only fetch the rest.
- Redownload — remove existing data for that run and download everything again.
From the CLI, use --redownload to force a full re-fetch, or answer the prompt when you run without the flag. From the API, pass redownload=True.
Development
git clone https://github.com/talhasiddique7/sec-fetcher.git && cd sec-fetcher
python -m venv .venv && . .venv/bin/activate
pip install -e ".[test]"
pytest
Releasing to PyPI
Push a version tag (e.g. v0.1.1) or trigger the workflow from the Actions tab.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secfetcher-0.1.2.tar.gz.
File metadata
- Download URL: secfetcher-0.1.2.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a6b5212c49f2238c26910e7c188b3325b4cb8bf8fe73d2e0eb2ebced6a80802
|
|
| MD5 |
c1b6f3d018d818104980f39643cb4301
|
|
| BLAKE2b-256 |
038d6547164640b3de3f5eade909efe2c322b350bab5348f6f56ed7a99bae659
|
File details
Details for the file secfetcher-0.1.2-py3-none-any.whl.
File metadata
- Download URL: secfetcher-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4befa1201e89fbfb01e70fdba0cf69450af6080c577d7ca4620b656d9aa3e23
|
|
| MD5 |
d509bd73959c8bc1f451c16c20280c82
|
|
| BLAKE2b-256 |
72e1469bf216cab216ad73a5ca0e4f2f2b39cee4c1dab603fe39f024965a99b9
|