### Install websockets client Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Install the necessary Python library for WebSocket communication. ```bash pip install websockets ``` -------------------------------- ### Install SEC-API Python Library Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Install the SEC-API Python library using pip. Ensure you have Python and pip installed. ```bash pip install sec-api ``` -------------------------------- ### Example Response from Mapping API Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This is an example of the JSON response structure when resolving company details using the Mapping API. It includes various company attributes. ```json [ { "name": "Tesla Inc", "ticker": "TSLA", "cik": "1318605", "cusip": "88160R101", "exchange": "NASDAQ", "isDelisted": false, "category": "Domestic Common Stock", "sector": "Consumer Cyclical", "industry": "Auto Manufacturers", "sic": "3711", "sicSector": "Manufacturing", "sicIndustry": "Motor Vehicles & Passenger Car Bodies", "famaSector": "", "famaIndustry": "Automobiles and Trucks", "currency": "USD", "location": "California; U.S.A", "id": "e27d6e9606f216c569e46abf407685f3" } ] ``` -------------------------------- ### Get Investment Adviser Brochures Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves a list of brochures for a given adviser ID. Requires the FormAdvApi to be initialized. ```python response = formAdvApi.get_brochures(149777) print(response["brochures"]) ``` -------------------------------- ### Form 1-K API Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This section explains how to use the Form1KApi class to retrieve Form 1-K filings. It provides a Python code example and an example of the response structure. ```APIDOC ## Form 1-K API ### Description Use the `Form1KApi` class to search for and retrieve Form 1-K filings from the SEC. This API allows you to query filings based on various criteria and retrieve structured data. ### Method `get_data(search_params)` ### Parameters #### Request Body - **search_params** (dict) - A dictionary containing search parameters such as `query`, `from`, `size`, and `sort`. ### Request Example ```python from sec_api import Form1KApi form1KApi = Form1KApi("YOUR_API_KEY") search_params = { "query": "fileNo:24R-00472", "from": "0", "size": "50", "sort": [{"filedAt": {"order": "desc"}}], } response = form1KApi.get_data(search_params) form1Ks = response["data"] print(form1Ks) ``` ### Response #### Success Response (200) - **total** (dict) - Contains the total number of results and the relation. - **data** (list) - A list of Form 1-K filing objects, each containing details like `id`, `accessionNo`, `formType`, `filedAt`, `periodOfReport`, `cik`, `companyName`, `item1`, and `summaryInfo`. #### Response Example ```json { "total": { "value": 4, "relation": "eq" }, "data": [ { "id": "9e7259d5bfcc20d7bdf19c7037ab1186", "accessionNo": "0001493152-25-009865", "formType": "1-K", "filedAt": "2025-03-11T16:38:05-04:00", "periodOfReport": "2024-12-31", "cik": "1786471", "companyName": "Aptera Motors Corp", "item1": { "formIndication": "Annual Report", "fiscalYearEnd": "12-31-2024", "city": "Carlsbad", "stateOrCountry": "CA" }, "summaryInfo": [ { "commissionFileNumber": "024-11479", "offeringQualificationDate": "05-19-2021", "qualifiedSecuritiesSold": 14000000, "offeringSecuritiesSold": 12630689, "pricePerSecurity": 8.02, "aggregrateOfferingPrice": 101297126, "issuerNetProceeds": 99964154 } ] } ] } ``` ``` -------------------------------- ### Retrieve Form 13F Cover Pages with Python Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use Form13FCoverPagesApi to get metadata from Form 13F cover pages. This example queries filings within a specific date range for a given CIK and prints manager name, report period, and total value. ```python from sec_api import Form13FCoverPagesApi form13FCoverPagesApi = Form13FCoverPagesApi(api_key="YOUR_API_KEY") response = form13FCoverPagesApi.get_data({ "query": "cik:1350694 AND periodOfReport:[2023-01-01 TO 2024-12-31]", "from": "0", "size": "10", "sort": [{"filedAt": {"order": "desc"}}] }) for filing in response["data"]: mgr = filing["filingManager"] print(f"{mgr['name']} | {filing['periodOfReport']} | Total value: ${filing['tableValueTotal']:,}") ``` -------------------------------- ### Get All Datasets Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves a raw JSON list of all available datasets. No API key is required. ```APIDOC ## Get All Datasets ### Description Retrieves a raw JSON list of all available datasets. No API key is required. ### Method ```python datasets.get_all() ``` ### Response Example ```json [ { "datasetId": "1f11ba9b-e03a-6950-a464-a23fcc53ee6f", "datasetIdInUrl": "audit-fees", "name": "Audit Fees", "description": "Structured dataset of annual audit fees extracted from SEC filings...", "formTypes": ["DEF 14A"], "containerFormat": ".jsonl.gz", "fileTypes": ["JSONL"], "updatedAt": "2026-04-09T05:00:01.000Z", "earliestSampleDate": "2001-03-01", "totalRecords": null, "totalSize": 9792910 } ] ``` ``` -------------------------------- ### Retrieve Form 1-K Filings with sec-api-python Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Utilize the Form1KApi to fetch Form 1-K filings. This example demonstrates setting up search parameters including a specific file number, date range, and sorting. ```python from sec_api import Form1KApi form1KApi = Form1KApi("YOUR_API_KEY") search_params = { "query": "fileNo:24R-00472", "from": "0", "size": "50", "sort": [{"filedAt": {"order": "desc"}}], } response = form1KApi.get_data(search_params) form1Ks = response["data"] print(form1Ks) ``` -------------------------------- ### Form 1-Z API Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This section describes the usage of the Form1ZApi class for retrieving Form 1-Z filings. It includes a Python code example and an example of the response structure. ```APIDOC ## Form 1-Z API ### Description Use the `Form1ZApi` class to search for and retrieve Form 1-Z filings from the SEC. This API allows you to query filings based on various criteria and retrieve structured data. ### Method `get_data(search_params)` ### Parameters #### Request Body - **search_params** (dict) - A dictionary containing search parameters such as `query`, `from`, `size`, and `sort`. ### Request Example ```python from sec_api import Form1ZApi form1ZApi = Form1ZApi("YOUR_API_KEY") search_params = { "query": "cik:*", "from": "0", "size": "50", "sort": [{"filedAt": {"order": "desc"}}], } response = form1ZApi.get_data(search_params) form1Zs = response["data"] print(form1Zs) ``` ### Response #### Success Response (200) - **total** (dict) - Contains the total number of results and the relation. - **data** (list) - A list of Form 1-Z filing objects, each containing details like `id`, `accessionNo`, `formType`, `filedAt`, `cik`, `ticker`, `companyName`, `item1`, `summaryInfoOffering`, and `certificationSuspension`. #### Response Example ```json { "total": { "value": 361, "relation": "eq" }, "data": [ { "id": "9b9dfa9d1532fbe9150cea549881f0cc", "accessionNo": "0001683168-26-002068", "formType": "1-Z/A", "filedAt": "2026-03-23T06:02:42-04:00", "cik": "1585380", "ticker": "INKW", "companyName": "Greene Concepts, Inc", "item1": { "issuerName": "Greene Concepts, Inc.", "city": "Marion", "stateOrCountry": "NC" }, "summaryInfoOffering": [ { "offeringQualificationDate": "04-03-2023", "offeringSecuritiesQualifiedSold": 4500000000, "offeringSecuritiesSold": 3047136365, "pricePerSecurity": 0.0006, "issuerNetProceeds": 1932001 } ], "certificationSuspension": [ { "securitiesClassTitle": "Common Stock", "approxRecordHolders": 5050 } ] } ] } ``` ``` -------------------------------- ### Example Response from EDGAR Entities Database Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This is an example response from the EDGAR Entities Database API, showing details for a specific entity like Tesla, Inc. It includes address, financial, and filing information. ```json { "total": { "value": 1, "relation": "eq" }, "data": [ { "id": "1318605", "cik": "1318605", "name": "Tesla, Inc.", "businessAddress": { "street1": "1 TESLA ROAD", "city": "AUSTIN", "state": "TX", "stateName": "TEXAS", "zip": "78725" }, "mailingAddress": { "street1": "1 TESLA ROAD", "city": "AUSTIN", "state": "TX", "stateName": "TEXAS", "zip": "78725" }, "stateOfIncorporation": "TX", "phone": "512-516-8177", "irsNo": "912197729", "fiscalYearEnd": "1231", "sic": "3711", "sicLabel": "3711 MOTOR VEHICLES & PASSENGER CAR BODIES", "formTypes": { "4": true, "144": true, "8-K": true, "10-Q": true, "10-K": true }, "filerCategory": "Large Accelerated Filer", "currentReportingStatus": true, "wellKnownSeasonedIssuer": true, "auditorName": "PricewaterhouseCoopers LLP", "auditorLocation": "San Jose, California" } ] } ``` -------------------------------- ### Get Executive Compensation Data by CIK Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Use the ExecCompApi to retrieve executive compensation data for a given CIK. Requires an API key. ```python from sec_api import ExecCompApi execCompApi = ExecCompApi("YOUR_API_KEY") # Get data by CIK result_cik = execCompApi.get_data("789019") ``` -------------------------------- ### Get All Datasets (Raw JSON) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves a raw JSON list of all available datasets. No API key is required for this operation. ```python all_datasets = datasets.get_all() ``` -------------------------------- ### Extract 10-Q Section Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This example demonstrates how to extract a section from a 10-Q filing. The API call is similar to 10-K extraction, requiring the filing URL and section identifier. ```python # # 10-Q example # # Tesla 10-Q filing filing_url_10q = "https://www.sec.gov/Archives/edgar/data/1318605/000095017022006034/tsla-20220331.htm" ``` -------------------------------- ### Get Executive Compensation Data by Ticker Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Use the ExecCompApi to retrieve executive compensation data for a given company ticker. Requires an API key. ```python from sec_api import ExecCompApi execCompApi = ExecCompApi("YOUR_API_KEY") # Get data by ticker result_ticker = execCompApi.get_data("TSLA") ``` -------------------------------- ### Search Form N-CEN Filings with Python Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Utilize the FormNcenApi to retrieve Form N-CEN filings, which are annual reports by investment companies. This example searches for 'Exchange-Traded Fund' filings and requires an API key. ```python from sec_api import FormNcenApi formNcenApi = FormNcenApi("YOUR_API_KEY") search_params = { "query": 'managementInvestmentQuestionSeriesInfo.fundTypes:"Exchange-Traded Fund"', "from": "0", "size": "10", "sort": [{"filedAt": {"order": "desc"}}], } response = formNcenApi.get_data(search_params) print(response["data"]) ``` -------------------------------- ### Get Separately Managed Accounts (Schedule D, Section 5.K) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves details about separately managed accounts, including asset distributions, borrowings, derivatives, and custodians. Requires the 'formAdvApi' object. ```python separately_managed_accounts = formAdvApi.get_separately_managed_accounts(crd="149777") print(separately_managed_accounts) ``` -------------------------------- ### Access Form 13F Holdings with Python Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Utilize Form13FHoldingsApi to retrieve institutional portfolio holdings. This example shows how to fetch the most recent 13F filing for a specific CIK and print summary information. ```python from sec_api import Form13FHoldingsApi form13FApi = Form13FHoldingsApi(api_key="YOUR_API_KEY") # Get Berkshire Hathaway's most recent 13F holdings response = form13FApi.get_data({ "query": "cik:1067983", "from": "0", "size": "1", "sort": [{"filedAt": {"order": "desc"}}] }) filing = response["data"][0] print(f"Period: {filing['periodOfReport']} | Holdings: {len(filing['holdings'])}") for holding in filing["holdings"][:5]: print(f" {holding['nameOfIssuer']:<30} CUSIP:{holding['cusip']} ${holding['value']:>15,}") ``` -------------------------------- ### List Available SEC Datasets Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Initializes the Datasets object and lists all available SEC datasets. ```python from sec_api import Datasets datasets = Datasets() ``` -------------------------------- ### Show All Datasets (Formatted Output) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Displays a formatted table of all available datasets in the terminal. This is a convenient way to browse dataset information. ```python datasets.show_all() ``` -------------------------------- ### Download SEC Dataset as ZIP Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Downloads an entire SEC dataset as a single ZIP file. Useful for obtaining a complete snapshot. ```python datasets.download("form-10k-content", strategy="zip") ``` -------------------------------- ### Sync Dataset (Incremental Download) Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the Datasets class with the 'sync' method (alias for download) to fetch only new or updated data containers. This is useful for daily updates. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # Sync (alias for download — only fetches new/updated containers) datasets.sync("form-10k-content", path="./my-data/10k") # Use in a daily cron job (0 6 * * * python sync.py) datasets.sync("form-nport") ``` -------------------------------- ### Form 1-A API Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This section details how to use the Form1AApi class to search and retrieve Form 1-A filings. It includes a Python code example and an example response structure. ```APIDOC ## Form 1-A API ### Description Use the `Form1AApi` class to search for and retrieve Form 1-A filings from the SEC. This API allows you to query filings based on various criteria and retrieve structured data. ### Method `get_data(search_params)` ### Parameters #### Request Body - **search_params** (dict) - A dictionary containing search parameters such as `query`, `from`, `size`, and `sort`. ### Request Example ```python from sec_api import Form1AApi form1AApi = Form1AApi("YOUR_API_KEY") search_params = { "query": "summaryInfo.indicateTier1Tier2Offering:Tier1", "from": "0", "size": "50", "sort": [{"filedAt": {"order": "desc"}}], } response = form1AApi.get_data(search_params) form1A = response["data"][0] print(form1A) ``` ### Response #### Success Response (200) - **total** (dict) - Contains the total number of results and the relation. - **data** (list) - A list of Form 1-A filing objects, each containing details like `id`, `accessionNo`, `formType`, `filedAt`, `cik`, `companyName`, `issuerInfo`, and `summaryInfo`. #### Response Example ```json { "total": { "value": 1954, "relation": "eq" }, "data": [ { "id": "3049ff20a7a655422f33f02c192c75bf", "accessionNo": "0001493152-26-012984", "formType": "1-A", "filedAt": "2026-03-26T17:11:42-04:00", "cik": "1587603", "companyName": "WINNERS, INC.", "issuerInfo": { "street1": "401 RYLAND STREET", "city": "RENO", "stateOrCountry": "NV", "totalAssets": 475537, "totalLiabilities": 838770, "totalRevenues": 495, "netIncome": -978989 }, "summaryInfo": { "indicateTier1Tier2Offering": "Tier1", "financialStatementAuditStatus": "Unaudited", "securitiesOfferedTypes": ["Equity (common or preferred stock)"], "securitiesOffered": 10000000, "pricePerSecurity": 0.5, "totalAggregateOffering": 5000000 } } ] } ``` ``` -------------------------------- ### Search SRO Filings Database with Python Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Utilize the SroFilingsApi to query the SRO Filings database. This example demonstrates searching for filings from a specific SRO (NASDAQ) with pagination and sorting by issue date. An API key is required. ```python from sec_api import SroFilingsApi sroFilingsApi = SroFilingsApi("YOUR_API_KEY") query = { "query": "sro:NASDAQ", "from": "0", "size": "10", "sort": [{"issueDate": {"order": "desc"}}], } response = sroFilingsApi.get_data(query) print(response["data"]) ``` -------------------------------- ### Download All 10-K Filings Incrementally Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the Datasets class to download all 10-K filings. This method supports incremental and resumable downloads, saving files to a default directory. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # Download all 10-K filings (incremental, resumable) downloaded_files = datasets.download("form-10k-content") # Saves to ./sec-api-datasets/form-10k-content/YYYY/YYYY-MM.zip ``` -------------------------------- ### Get Dataset Details Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves detailed information about a specific dataset, identified by its ID. ```APIDOC ## Get Dataset Details ### Description Retrieves detailed information about a specific dataset, identified by its ID. ### Method ```python details = datasets.get_dataset_details("form-10k-content") ``` ### Response Example ```json { "datasetId": "1f11bb55-d58b-6080-bace-e7a62567f4b9", "datasetDownloadUrl": "https://api.sec-api.io/datasets/form-10k-content.zip", "name": "Form 10-K - Annual Reports - Filing Contents", "description": "HTML and TXT files of all Form 10-K filings published since 1993...", "updatedAt": "2026-04-09T07:07:57.058Z", "earliestSampleDate": "1993-10-01", "totalRecords": 303021, "totalSize": 33809939825, "formTypes": [ "10-K", "10-K/A", "10-K405", "10-K405/A", "10-KSB", "10-KSB/A", "10-KT", "10-KT/A" ], "containerFormat": "ZIP", "fileTypes": ["TXT", "JSON", "HTML", "PAPER"], "containers": [ { "downloadUrl": "https://api.sec-api.io/datasets/form-10k-content/2026/2026-04.zip", "key": "2026/2026-04.zip", "size": 15593008, "records": 167, "updatedAt": "2026-04-09T07:07:57.058Z" } ] } ``` ``` -------------------------------- ### Get Direct Owners (Schedule A) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves direct owner information for a given CRD number. ```APIDOC ## Get Direct Owners (Schedule A) ### Description Retrieves direct owner information for a given CRD number. ### Method `formAdvApi.get_direct_owners(crd)` ### Parameters #### Path Parameters - **crd** (string) - Required - The CRD number to query. ### Response #### Success Response (200) - Returns an array of direct owner objects. ### Response Example ```json [ { "name": "ZEMLYAK, JAMES MARK", "ownerType": "I", "titleStatus": "EXECUTIVE VICE PRESIDENT & DIRECTOR", "dateTitleStatusAcquired": "2002-08", "ownershipCode": "NA", "isControlPerson": true, "isPublicReporting": false, "crd": "1586132" }, { "name": "STIFEL FINANCIAL CORP.", "ownerType": "DE", "titleStatus": "SHAREHOLDER", "dateTitleStatusAcquired": "1982-02", "ownershipCode": "E", "isControlPerson": true, "isPublicReporting": true } ] ``` ``` -------------------------------- ### Download Entire Dataset as Single ZIP Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the Datasets class with the 'zip' strategy to download an entire dataset as a single ZIP archive. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # Download entire dataset as single ZIP datasets.download("form-4", strategy="zip") ``` -------------------------------- ### Query SEC Filings with Python Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the QueryApi to retrieve a list of SEC filings based on specified criteria. Ensure the api_key is configured. ```python filings = queryApi.get_filings({ "query": "formType:\"10-K\"", "from": "0", "size": "5", "sort": [{"filedAt": {"order": "desc"}}] }) ``` -------------------------------- ### Show All Datasets (Formatted) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Displays a formatted table of all available datasets in the terminal. ```APIDOC ## Show All Datasets (Formatted) ### Description Displays a formatted table of all available datasets in the terminal. ### Method ```python datasets.show_all() ``` ### Terminal Output Example ``` ID Name Format Size ────────────────────────────────────────────────── ─────────────────────────────────────────────────────── ────────── ──────────── audit-fees Audit Fees .jsonl.gz 9.8 MB earnings-results-form-8-k-item-2-02 Earnings Results - Form 8-K, Item 2.02 (2004-Present) ZIP 154.6 GB ... 28 datasets available. Browse all at https://sec-api.io/datasets ``` ``` -------------------------------- ### Get Indirect Owners (Schedule B) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves indirect owner information for a given CRD number. ```APIDOC ## Get Indirect Owners (Schedule B) ### Description Retrieves indirect owner information for a given CRD number. ### Method `formAdvApi.get_indirect_owners(crd)` ### Parameters #### Path Parameters - **crd** (string) - Required - The CRD number to query. ### Response #### Success Response (200) - Returns an array of indirect owner objects. ### Response Example ```json [ { "name": "CORIENT PARTNERS LLC", "ownerType": "DE", "entityOwned": "CORIENT PRIVATE WEALTH LLC", "status": "OWNER", "dateStatusAcquired": "2022-02", "ownershipCode": "E", "isControlPerson": true, "isPublicReporting": false, "crd": "" }, { "name": "CI FINANCIAL CORP.", "ownerType": "FE", "entityOwned": "CORIENT HOLDINGS INC", "status": "OWNER", "dateStatusAcquired": "2019-11", "ownershipCode": "E", "isControlPerson": true, "isPublicReporting": false, "crd": "" } ] ``` ``` -------------------------------- ### Access Form N-PORT Holdings with Python Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use FormNportApi to search for mutual fund and ETF portfolio holdings. This example retrieves filings for funds with a minimum asset threshold within a specified reporting period. ```python from sec_api import FormNportApi nportApi = FormNportApi("YOUR_API_KEY") response = nportApi.get_data({ "query": "fundInfo.totAssets:[500000000 TO *] AND genInfo.repPdEnd:[2026-01-01 TO 2026-12-31]", "from": "0", "size": "5", "sort": [{"filedAt": {"order": "desc"}}], }) for filing in response["filings"]: info = filing["genInfo"] fund = filing["fundInfo"] print(f"{info['seriesName']} | Assets: ${fund['totAssets']:,.0f} | Holdings: {len(filing.get('invstOrSecs', []))}") ``` -------------------------------- ### List All Available Datasets Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the Datasets class to list all available bulk EDGAR filing datasets. No API key is required for this operation. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # List all available datasets (no API key required) all_datasets = datasets.get_all() datasets.show_all() ``` -------------------------------- ### Get Subsidiary Data by Query Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieve subsidiary data using a custom query, such as by ticker, with sorting. Requires an API key. ```python from sec_api import SubsidiaryApi subsidiaryApi = SubsidiaryApi("YOUR_API_KEY") query = { "query": "ticker:TSLA", "from": "0", "size": "50", "sort": [{"filedAt": {"order": "desc"}}], } response = subsidiaryApi.get_data(query) print(response["data"]) ``` -------------------------------- ### Get Voting Records by Accession Number Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves the voting records associated with a specific N-PX filing, identified by its accession number. ```APIDOC ## Get Voting Records by Accession Number ### Description Fetches the proxy voting records for a given N-PX filing using its accession number. ### Method `formNpxApi.get_voting_records(accessionNo)` ### Parameters #### Path Parameters - **accessionNo** (str) - Required - The accession number of the N-PX filing. ### Request Example ```python accessionNo = npx_filing_metadata[0]["accessionNo"] response = formNpxApi.get_voting_records(accessionNo) ``` ### Response #### Success Response (200) - **proxyVotingRecords** (list) - A list of proxy voting records. #### Response Example ```json { "id": "723cc6d725f186bd4436136332d7fc98", "accessionNo": "0001021408-25-003152", "formType": "N-PX", "filedAt": "2025-08-25T14:01:44-04:00", "periodOfReport": "2025-06-30", "cik": "884546", "companyName": "CHARLES SCHWAB INVESTMENT MANAGEMENT INC", "proxyVotingRecords": [ { "issuerName": "10x Genomics, Inc.", "cusip": "88025U109", "meetingDate": "06/03/2025", "voteDescription": "To approve, on a non-binding, advisory basis, the compensation of our named executive officers.", "voteCategories": { "voteCategory": [{ "categoryType": "SECTION 14A SAY-ON-PAY VOTES" }] }, "voteSource": "ISSUER", "sharesVoted": 653315, "vote": { "voteRecord": [ { "howVoted": "AGAINST", "sharesVoted": 653315, "managementRecommendation": "AGAINST" } ] } } ] } ``` ``` -------------------------------- ### Download Entire Datasets of SEC Filings Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md This snippet shows how to download entire datasets of SEC filings, such as all 10-K filings or all 13-F holdings, using the `Datasets` class. The `download` method takes a dataset identifier. ```APIDOC ## Download Entire Datasets of SEC Filings ### Description This function downloads entire datasets of SEC filings, such as all 10-K filings or all 13-F holdings. ### Method `download(dataset_name: str)` ### Parameters #### Path Parameters - **dataset_name** (str) - Required - The name of the dataset to download (e.g., "form-10k-content", "form-13f-holdings"). ### Request Example ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # downloads all 10-K filings (1993-present) to ./sec-api-datasets/form-10k-content/YYYY/YYYY-MM.zip datasets.download("form-10k-content") # all 13-F institutional holdings datasets.download("form-13f-holdings") ``` ### Response #### Success Response (200) - **None** - The function downloads the dataset to a local directory. ``` -------------------------------- ### Get Other Business Names Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieves a list of other business names associated with an entity, as reported in Schedule D, Section 1.B of Form ADV. ```APIDOC ## Get Other Business Names (Schedule D, Section 1.B) ### Description Retrieves a list of other business names associated with an entity. ### Method ```python formAdvApi.get_other_business_names(crd: str) ``` ### Parameters #### Path Parameters - **crd** (string) - Required - The CRD number of the entity. ### Response #### Success Response (200) - **name** (string) - The name of the other business. - **jurisdictions** (list of strings) - A list of state abbreviations where the business operates. ### Request Example ```python other_business_names = formAdvApi.get_other_business_names(crd="149777") ``` ### Response Example ```json [ { "name": "MORGAN STANLEY SMITH BARNEY", "jurisdictions": [ "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL" ] } ] ``` ``` -------------------------------- ### Show Specific Dataset Details (Formatted Output) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Displays the details of a specific dataset in a formatted manner in the terminal. This is useful for quickly viewing dataset properties. ```python datasets.show_dataset_details("form-10k-content") ``` -------------------------------- ### Get Direct Owners (Schedule A) Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Retrieve direct owner information for a given CRD number. This is useful for understanding who directly owns a firm. ```python direct_owners = formAdvApi.get_direct_owners(crd="793") print(direct_owners) ``` -------------------------------- ### Configure Proxy Support for API Wrappers Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Pass HTTP and HTTPS proxies into API wrappers like QueryApi and DownloadApi to resolve SSL certificate errors in corporate IT environments. Consult your IT administrator for proxy details. ```python from sec_api import QueryApi, DownloadApi, ... proxies = { "http": "http://your-proxy.com", "https": "https://your-proxy.com", } queryApi = QueryApi(api_key="YOUR_API_KEY", proxies=proxies) downloadApi = DownloadApi(api_key="YOUR_API_KEY", proxies=proxies) ``` -------------------------------- ### Extract Section from 8-K Filing Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Demonstrates how to extract a specific section from an 8-K filing. You can choose to get the content as plain text or as HTML. ```APIDOC ## Extract Section from 8-K Filing ### Description This example shows how to retrieve a specific section from an 8-K filing. The `get_section` method allows you to specify the filing URL, the desired section identifier, and the output format (text or html). ### Method `extractorApi.get_section(filing_url, section_id, output_format)` ### Parameters #### Path Parameters - **filing_url** (string) - Required - The URL of the SEC filing. - **section_id** (string) - Required - The identifier of the section to extract (e.g., "1.01", "2.02"). - **output_format** (string) - Required - The desired format for the output ('text' or 'html'). ### Request Example ```python from sec_api import ExtractorApi extractorApi = ExtractorApi("YOUR_API_KEY") filing_url_8k = "https://www.sec.gov/Archives/edgar/data/1000045/000119312523174508/0001193125-23-174508-index.htm" # Get the standardized and cleaned text of section 1.01 "Entry into a Material Definitive Agreement" section_text = extractorApi.get_section(filing_url_8k, "1.01", "text") # Get the original HTML of section 2.02 "Results of Operations and Financial Condition" section_html = extractorApi.get_section(filing_url_8k, "2.02", "html") ``` ### Response #### Success Response - **section_content** (string) - The extracted content of the specified section in the requested format (text or html). ``` -------------------------------- ### Extract Section from 10-Q Filing Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Demonstrates how to extract a specific section from a 10-Q filing. You can choose to get the content as plain text or as HTML. ```APIDOC ## Extract Section from 10-Q Filing ### Description This example shows how to retrieve a specific section from a 10-Q filing. The `get_section` method allows you to specify the filing URL, the desired section identifier, and the output format (text or html). ### Method `extractorApi.get_section(filing_url, section_id, output_format)` ### Parameters #### Path Parameters - **filing_url** (string) - Required - The URL of the SEC filing. - **section_id** (string) - Required - The identifier of the section to extract (e.g., "1", "1A", "2"). - **output_format** (string) - Required - The desired format for the output ('text' or 'html'). ### Request Example ```python from sec_api import ExtractorApi extractorApi = ExtractorApi("YOUR_API_KEY") filing_url_10q = "https://www.sec.gov/Archives/edgar/data/1318605/000095017022006034/tsla-20220331.htm" # Get the standardized and cleaned text of section 1 "Financial Statements" section_text = extractorApi.get_section(filing_url_10q, "1", "text") # Get the original HTML of section 1A "Risk Factors" section_html = extractorApi.get_section(filing_url_10q, "1A", "html") ``` ### Response #### Success Response - **section_content** (string) - The extracted content of the specified section in the requested format (text or html). ``` -------------------------------- ### Download Entire Datasets of SEC Filings Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Utilize the Datasets class to download comprehensive collections of SEC filings, such as all 10-K reports or 13-F holdings. Specify the dataset name to download. Replace YOUR_API_KEY with your actual API key. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # downloads all 10-K filings (1993-present) to ./sec-api-datasets/form-10k-content/YYYY/YYYY-MM.zip datasets.download("form-10k-content") # all 13-F institutional holdings datasets.download("form-13f-holdings") ``` -------------------------------- ### Search Form N-PORT Filings with Python Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Use the FormNportApi to search for N-PORT filings based on specified criteria. Requires an API key and defines search parameters like query, size, and sorting. ```python from sec_api import FormNportApi nportApi = FormNportApi("YOUR_API_KEY") search_params = { "query": "fundInfo.totAssets:[100000000 TO *]", "from": "0", "size": "10", "sort": [{"filedAt": {"order": "desc"}}], } response = nportApi.get_data(search_params) print(response["filings"]) ``` -------------------------------- ### Extract Section from 10-K Filing Source: https://github.com/sec-api-io/sec-api-python/blob/master/README.md Demonstrates how to extract a specific section from a 10-K filing. You can choose to get the content as plain text or as HTML. ```APIDOC ## Extract Section from 10-K Filing ### Description This example shows how to retrieve a specific section from a 10-K filing. The `get_section` method allows you to specify the filing URL, the desired section identifier, and the output format (text or html). ### Method `extractorApi.get_section(filing_url, section_id, output_format)` ### Parameters #### Path Parameters - **filing_url** (string) - Required - The URL of the SEC filing. - **section_id** (string) - Required - The identifier of the section to extract (e.g., "1A", "7"). - **output_format** (string) - Required - The desired format for the output ('text' or 'html'). ### Request Example ```python from sec_api import ExtractorApi extractorApi = ExtractorApi("YOUR_API_KEY") filing_url_10k = "https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231.htm" # Get the standardized and cleaned text of section 1A "Risk Factors" section_text = extractorApi.get_section(filing_url_10k, "1A", "text") # Get the original HTML of section 7 "Management’s Discussion and Analysis of Financial Condition and Results of Operations" section_html = extractorApi.get_section(filing_url_10k, "7", "html") ``` ### Response #### Success Response - **section_content** (string) - The extracted content of the specified section in the requested format (text or html). ``` -------------------------------- ### Get Details for a Specific Dataset Source: https://context7.com/sec-api-io/sec-api-python/llms.txt Use the Datasets class to retrieve details for a particular EDGAR filing dataset. No API key is required. ```python from sec_api import Datasets datasets = Datasets(api_key="YOUR_API_KEY") # Get details for a specific dataset (no API key required) details = datasets.get_dataset_details("form-10k-content") datasets.show_dataset_details("form-10k-content") ```