{"id":21915667,"url":"https://github.com/elijas/sec-api-io","last_synced_at":"2025-04-18T21:51:17.334Z","repository":{"id":199551817,"uuid":"703238566","full_name":"Elijas/sec-api-io","owner":"Elijas","description":"Unofficial wrapper for the sec-api.io API. Search \u0026 filter SEC filings.","archived":false,"fork":false,"pushed_at":"2023-11-22T08:24:09.000Z","size":959,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T18:23:48.060Z","etag":null,"topics":["10-k","10-q","8-k","cik","downloader","edgar","edgar-api","edgar-crawler","edgar-database","edgar-scraper","filings","gov","gov-edgar-filings","insider-trading","python","sec","sec-api"],"latest_commit_sha":null,"homepage":"https://elijas.github.io/sec-api-io/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elijas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-10T21:32:09.000Z","updated_at":"2024-04-24T18:23:48.061Z","dependencies_parsed_at":"2023-11-22T08:46:28.038Z","dependency_job_id":null,"html_url":"https://github.com/Elijas/sec-api-io","commit_stats":null,"previous_names":["elijas/sec-api-io"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elijas%2Fsec-api-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elijas%2Fsec-api-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elijas%2Fsec-api-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elijas%2Fsec-api-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elijas","download_url":"https://codeload.github.com/Elijas/sec-api-io/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226971317,"owners_count":17711413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["10-k","10-q","8-k","cik","downloader","edgar","edgar-api","edgar-crawler","edgar-database","edgar-scraper","filings","gov","gov-edgar-filings","insider-trading","python","sec","sec-api"],"created_at":"2024-11-28T19:13:18.491Z","updated_at":"2024-11-28T19:13:19.180Z","avatar_url":"https://github.com/Elijas.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sec-api-io\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\n\u003ca href=\"https://github.com/elijas/sec-api-io/actions/workflows/test.yaml\"\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/elijas/sec-api-io/test.yaml?label=build\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/sec-api-io/\"\u003e\u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/sec-api-io\"\u003e\u003c/a\u003e\n\u003ca href=\"https://badge.fury.io/py/sec-api-io\"\u003e\u003cimg src=\"https://badge.fury.io/py/sec-api-io.svg\" alt=\"PyPI version\" /\u003e\u003c/a\u003e\n\u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/elijas/sec-api-io.svg\" alt=\"Licence\"\u003e\u003c/a\u003e\n\nUnofficial wrapper for the [sec-api.io API](https://sec-api.io). Built\nwith [nbdev](https://nbdev.fast.ai/).\n\n## Install and Setup\n\nRun in terminal:\n\n``` sh\npip install sec_api_io\n```\n\n## How to use\n\n### (Optional) Set API key with `.env` file\n\nIt’s highly recommended to set your API key in a `.env` file to avoid\nsetting it in the code.\n\n1.  Make a copy of the `.env.template` file in the root directory of the\n    project.\n2.  Rename the copied file to `.env`.\n3.  Open the `.env` file and locate the `SECAPIO_API_KEY` variable.\n4.  Fill in the value for the `SECAPIO_API_KEY` variable.\n    - You can obtain a free key from [sec-api.io](https://sec-api.io/).\n    - Note: The first 100 requests are free.\n5.  Save the `.env` file next to your notebook or script.\n\n\u003e **Important Note:** Depending on your geographical location, you might\n\u003e need to use a VPN set to a United States location to access\n\u003e [sec-api.io](https://sec-api.io/) API.\n\nLet’s load the API key from .env file into the environment variable\nSECAPIO_API_KEY\n\n``` python\n!pip install -q python-dotenv\n```\n\n``` python\nfrom dotenv import load_dotenv\n\nload_dotenv() # Load the API key from .env file into the environment variable SECAPIO_API_KEY\n```\n\n    True\n\n``` python\nimport os \nfrom dotenv import load_dotenv\n\nif 'SECAPIO_API_KEY' not in os.environ:\n    assert load_dotenv()\n    \nassert 'SECAPIO_API_KEY' in os.environ\n```\n\n``` python\nimport os \nfrom dotenv import load_dotenv\n\nif 'SECAPIO_API_KEY' not in os.environ:\n    assert load_dotenv()\n    \nassert 'SECAPIO_API_KEY' in os.environ\nassert os.environ['SECAPIO_API_KEY'].strip()\n```\n\n### Get latest 10-Q report by ticker\n\n``` python\nfrom sec_api_io.secapio_data_retriever import SecapioDataRetriever\n\nretriever = SecapioDataRetriever()\n# retriever = SecapioDataRetriever(api_key=...) # If you don't want to use .env file\n\nmetadata = retriever.retrieve_report_metadata('10-Q', latest_from_ticker='AAPL')\nurl = metadata[\"linkToFilingDetails\"]\n\nassert url.startswith('https://www.sec.gov/Archives/edgar/data/')\nurl\n```\n\n    'https://www.sec.gov/Archives/edgar/data/320193/000032019323000077/aapl-20230701.htm'\n\n### Download 10-Q HTML split into sections\n\n``` python\nhtml = retriever.get_report_html('10-Q', url)\nassert html\n```\n\n``` python\nfor line in html.splitlines():\n    print(line[:65] + '...')\n```\n\n    \u003ctop-level-section-separator id=\"part1item1\" title=\"Financial Statemen...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part1item2\" title=\"Management's Discu...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part1item3\" title=\"Quantitative and Q...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part1item4\" title=\"Controls and Proce...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item1\" title=\"Legal Proceedings\"...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item1a\" title=\"Risk Factors\" com...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item2\" title=\"Unregistered Sales...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item3\" title=\"Defaults Upon Seni...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item4\" title=\"Mine Safety Disclo...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item5\" title=\"Other Information\"...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n    \u003ctop-level-section-separator id=\"part2item6\" title=\"Exhibits\" comment=...\n    \u003cspan style=\"color:#000000;font-family:'Helvetica',sans-serif;fon...\n\n## Contributing\n\nFollow these steps to install the project locally for development:\n\n1.  Install the project with the command `pip install -e \".[dev]\"`.\n\n\u003e **Note** We highly recommend using virtual environments for Python\n\u003e development. If you’d like to use virtual environments, follow these\n\u003e steps instead: - Create a virtual environment\n\u003e `python3 -m venv .venv` - Activate the virtual environment\n\u003e `source .venv/bin/activate` - Install the project with the command\n\u003e `pip install -e \".[dev]\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijas%2Fsec-api-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felijas%2Fsec-api-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijas%2Fsec-api-io/lists"}