Skip to content

Commit 8c181f4

Browse files
added Form 13F holdings + cover pages API, Form N-PX proxy voting records, SEC enforcement actions, SEC administrative proceedings
1 parent a9efa7f commit 8c181f4

File tree

5 files changed

+559
-121
lines changed

5 files changed

+559
-121
lines changed

README.md

+191-64
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
# SEC API - A SEC.gov EDGAR Filings Query & Real-Time Stream API
22

3-
**sec-api** is a Python package allowing you to search the entire SEC EDGAR filings corpus and access petabytes of regulatory information published by public and private companies, insiders such as directors and board members, hedge and mutual funds, financial advisors, business development companies, and more.
3+
**sec-api** is a Python package allowing you to search the entire SEC EDGAR filings corpus and access petabytes of regulatory information published by public and private companies, insiders such as directors and board members, hedge and mutual funds, financial advisors, business development companies, and more. It includes:
44

5-
It includes:
6-
7-
**EDGAR Filing Search & Download**
5+
**EDGAR Filing Search & Download APIs**
86

97
- [SEC Filing Search and Full-Text Search API](#sec-edgar-filings-query-api)
108
- [Real-Time Filing Stream API](#sec-edgar-filings-real-time-stream-api)
11-
- [Filing Download & PDF Render API](#filing-render--download-api)
12-
- [PDF Generator API](#pdf-generator-api)
9+
- [Download API - Download any SEC filing, exhibit and attached file](#filing--exhibit-download-api)
10+
- [PDF Generator API - Download SEC filings and exhibits as PDF](#pdf-generator-api)
1311

14-
**Converter & Extractor APIs:**
12+
**Converter & Extractor APIs**
1513

1614
- [XBRL-to-JSON Converter API + Financial Statements](#xbrl-to-json-converter-api)
1715
- [10-K/10-Q/8-K Section Extraction API](#10-k10-q8-k-section-extractor-api)
1816

19-
**Ownership Data APIs:**
17+
**Investment Advisers**
18+
19+
- [Form ADV API - Investment Advisors (Firm & Indvl. Advisors, Brochures, Schedules)](#form-adv-api)
20+
21+
**Ownership Data APIs**
2022

21-
- [Form 3/4/5 API - Insider Trading](#insider-trading-data-api)
22-
- [Form 13F API - Institutional Investment Manager Holdings](#form-13f-institutional-holdings-database)
23+
- [Form 3/4/5 API - Insider Trading Disclosures](#insider-trading-data-api)
24+
- [Form 13F API - Institutional Investment Manager Holdings & Cover Pages](#form-13f-institutional-holdings-database)
2325
- [Form 13D/13G API - Activist and Passive Investor Holdings](#form-13d-13g-api)
24-
- [Form N-PORT API - Mutual Fund Holdings](#form-n-port-api)
26+
- [Form N-PORT API - Mutual Funds, ETFs and Closed-End Fund Holdings](#form-n-port-api)
2527

26-
**Security Offerings APIs:**
28+
**Proxy Voting Records**
2729

28-
- [Form S-1/424B4 API - Registration Statements and Prospectuses (IPOs, Debt/Warrants/... Offerings)](#form-s-1424b4-api)
29-
- [Form D API - Private Security Offerings](#form-d-api)
30+
- [Form N-PX Proxy Voting Records API](#form-n-px-proxy-voting-records-api)
3031

31-
**Investment Advisers:**
32+
**Security Offerings APIs**
3233

33-
- [Form ADV API - Investment Advisors (Firm & Indvl. Advisors, Brochures, Schedules)](#form-adv-api)
34+
- [Form S-1/424B4 API - Registration Statements and Prospectuses (IPOs, Debt/Warrants/... Offerings)](#form-s-1424b4-api)
35+
- [Form D API - Private Security Offerings](#form-d-api)
3436

3537
**Structured Material Event Data from Form 8-K**
3638

@@ -45,13 +47,15 @@ It includes:
4547
- [Outstanding Shares & Public Float](#outstanding-shares--public-float-api)
4648
- [Company Subsidiary API](#subsidiary-api)
4749

48-
**Enforcement Actions & SRO Filings:**
50+
**Enforcement Actions, Proceedings, AAERs & SRO Filings**
4951

52+
- [SEC Enforcement Actions](#sec-enforcement-actions-database-api)
5053
- [SEC Litigation Releases](#sec-litigation-releases-database-api)
54+
- [SEC Administrative Proceedings](#sec-administrative-proceedings-database-api)
5155
- [AAER Database API - Accounting and Auditing Enforcement Releases](#aaer-database-api)
5256
- [SRO Filings Database API](#sro-filings-database-api)
5357

54-
**Other APIs:**
58+
**Other APIs**
5559

5660
- [CUSIP/CIK/Ticker Mapping API](#cusipcikticker-mapping-api)
5761
- [EDGAR Entities Database API](#edgar-entities-database)
@@ -154,28 +158,42 @@ print(filings)
154158

155159
> See the documentation for more details: https://sec-api.io/docs/full-text-search-api
156160
157-
## Filing Render & Download API
161+
## Filing & Exhibit Download API
158162

159-
Used to download any filing or exhibit. You can process the downloaded filing in memory or save the filing to your hard drive.
163+
Download any SEC EDGAR filing, exhibit and attached file in its original format (HTML, XML, JPEG, Excel, text, PDF, etc.). The API supports downloading all EDGAR form types, including 10-K, 10-Q, 8-K, 13-F, S-1, 424B4, and many others published since 1993 and provides access to over 18 million filings and over 100 million exhibits and filing attachments. Download up to 40 files per second.
160164

161165
```python
162166
from sec_api import RenderApi
163167

164168
renderApi = RenderApi(api_key="YOUR_API_KEY")
165169

166-
url = "https://www.sec.gov/Archives/edgar/data/1662684/000110465921082303/tm2119986d1_8k.htm"
167-
168-
filing = renderApi.get_filing(url)
169-
170-
print(filing)
171-
172-
# for non-text data, such as a PDF files or an images,
173-
# use get_file() and set `return_binary=True` to get the binary data
174-
pdf_file_url = "https://www.sec.gov/Archives/edgar/data/1798925/999999999724004095/filename1.pdf"
175-
binary_data = renderApi.get_file(pdf_file_url, return_binary=True)
176-
177-
with open("filename.pdf", "wb") as f:
178-
f.write(binary_data)
170+
# example URLs: SEC filings, exhibits, images, Excel sheets, PDFs
171+
url_8k_html = "https://www.sec.gov/Archives/edgar/data/1045810/000104581023000014/nvda-20230222.htm"
172+
url_8k_txt = "https://www.sec.gov/Archives/edgar/data/1045810/000104581023000014/0001045810-23-000014.txt"
173+
url_exhibit99 = "https://www.sec.gov/Archives/edgar/data/1045810/000104581023000014/q4fy23pr.htm"
174+
url_xbrl_instance = "https://www.sec.gov/Archives/edgar/data/1045810/000104581023000014/nvda-20230222_htm.xml"
175+
url_excel_file = "https://www.sec.gov/Archives/edgar/data/1045810/000104581023000014/Financial_Report.xlsx"
176+
url_pdf_file = "https://www.sec.gov/Archives/edgar/data/1798925/999999999724004095/filename1.pdf"
177+
url_image_file = "https://www.sec.gov/Archives/edgar/data/1424404/000106299324017776/form10kxz001.jpg"
178+
179+
filing_8k_html = renderApi.get_file(url_8k_html)
180+
filing_8k_txt = renderApi.get_file(url_8k_txt)
181+
exhibit99 = renderApi.get_file(url_exhibit99)
182+
xbrl_instance = renderApi.get_file(url_xbrl_instance)
183+
184+
# use .get_file() and set return_binary=True
185+
# to get non-text files such as images, PDFs, etc.
186+
excel_file = renderApi.get_file(url_excel_file, return_binary=True)
187+
pdf_file = renderApi.get_file(url_pdf_file, return_binary=True)
188+
image_file = renderApi.get_file(url_image_file, return_binary=True)
189+
190+
# save files to disk
191+
with open("filing_8k_html.htm", "wb") as f:
192+
f.write(filing_8k_html.encode("utf-8"))
193+
with open("pdf_file.pdf", "wb") as f:
194+
f.write(pdf_file)
195+
with open("image.jpg", "wb") as f:
196+
f.write(image_file)
179197
```
180198

181199
> See the documentation for more details: https://sec-api.io/docs/sec-filings-render-api
@@ -189,15 +207,19 @@ from sec_api import PdfGeneratorApi
189207

190208
pdfGeneratorApi = PdfGeneratorApi("YOUR_API_KEY")
191209

192-
# Form 8-K exhibit URL
193-
edgar_file_url = "https://www.sec.gov/ix?doc=/Archives/edgar/data/1320695/000132069520000148/ths12-31x201910krecast.htm"
194-
# Form 10-K filing URL
195-
# edgar_file_url = "https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926.htm"
210+
# examples: 10-K filing, Form 8-K exhibit
211+
url_10k_filing = "https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926.htm"
212+
url_8k_exhibit_url = "https://www.sec.gov/ix?doc=/Archives/edgar/data/1320695/000132069520000148/ths12-31x201910krecast.htm"
196213

197-
pdf_file = pdfGeneratorApi.get_pdf(edgar_file_url)
214+
# get PDFs
215+
pdf_10k_filing = pdfGeneratorApi.get_pdf(url_10k_filing)
216+
pdf_8k_exhibit = pdfGeneratorApi.get_pdf(url_8k_exhibit_url)
198217

199-
with open("filename.pdf", "wb") as f:
200-
f.write(pdf_file)
218+
# save PDFs to disk
219+
with open("pdf_10k_filing.pdf", "wb") as f:
220+
f.write(pdf_10k_filing)
221+
with open("pdf_8k_exhibit.pdf", "wb") as f:
222+
f.write(pdf_8k_exhibit)
201223
```
202224

203225
> See the documentation for more details: https://sec-api.io/docs/sec-filings-render-api
@@ -676,24 +698,51 @@ print(insider_trades["transactions"])
676698

677699
## Form 13F Institutional Holdings Database
678700

679-
Find the most recently disclosed Form 13F filings that include Tesla as a holding.
701+
Access Form 13F holdings in structured JSON format, including information on current and historical portfolio holdings of SEC-registered funds and investment managers, including issuer name, title of the securities class, CUSIP, CIK and ticker of the holding, value of the position in dollar, the number of shares held, investment discretion, voting authority, and more.
680702

681703
```python
682-
from sec_api import QueryApi
704+
from sec_api import Form13FHoldingsApi
683705

684-
queryApi = QueryApi(api_key="YOUR_API_KEY")
706+
form13FHoldingsApi = Form13FHoldingsApi(api_key="YOUR_API_KEY")
685707

686-
query = {
687-
"query": "formType:\"13F\" AND holdings.ticker:TSLA",
708+
search_params = {
709+
"query": "cik:1350694 AND periodOfReport:2024-03-31",
688710
"from": "0",
689711
"size": "10",
690712
"sort": [{ "filedAt": { "order": "desc" } }]
691713
}
692714

693-
filings = queryApi.get_filings(query)
715+
response = form13FHoldingsApi.get_data(search_params)
716+
holdings = response["data"]
717+
718+
print(holdings)
719+
```
720+
721+
> See the documentation for more details: https://sec-api.io/docs/form-13-f-filings-institutional-holdings-api
722+
723+
## Form 13F Cover Pages API
724+
725+
Search and access cover pages of Form 13F filings in standardized JSON format. Cover pages include details about the investment manager and fund, such as CIK, SEC file and CRD number, name, address, report type, other managers, and more.
726+
727+
```python
728+
from sec_api import Form13FCoverPagesApi
729+
730+
form13FCoverPagesApi = Form13FCoverPagesApi(api_key="YOUR_API_KEY")
731+
732+
search_params = {
733+
"query": "cik:1698218 AND periodOfReport:[2023-01-1 TO 2024-12-31]",
734+
"from": "0",
735+
"size": "10",
736+
"sort": [{ "filedAt": { "order": "desc" }}]
737+
}
738+
739+
response = form13FCoverPagesApi.get_data(query)
740+
cover_pages = response["data"]
741+
742+
print(cover_pages)
694743
```
695744

696-
> See the documentation for more details: https://sec-api.io/docs/query-api/13f-institutional-ownership-api
745+
> See the documentation for more details: https://sec-api.io/docs/form-13-f-filings-institutional-holdings-api
697746
698747
## Form 13D/13G API
699748

@@ -782,20 +831,54 @@ from sec_api import FormNportApi
782831

783832
nportApi = FormNportApi("YOUR_API_KEY")
784833

785-
response = nportApi.get_data(
786-
{
787-
"query": "fundInfo.totAssets:[100000000 TO *]",
788-
"from": "0",
789-
"size": "10",
790-
"sort": [{"filedAt": {"order": "desc"}}],
791-
}
792-
)
834+
search_params = {
835+
"query": "fundInfo.totAssets:[100000000 TO *]",
836+
"from": "0",
837+
"size": "10",
838+
"sort": [{"filedAt": {"order": "desc"}}],
839+
}
840+
841+
response = nportApi.get_data(search_params)
793842

794843
print(response["filings"])
795844
```
796845

797846
> See the documentation for more details: https://sec-api.io/docs/n-port-data-api
798847
848+
## Form N-PX Proxy Voting Records API
849+
850+
The Form N-PX API consists of two APIs: the N-PX Search API and the Voting Records API. The N-PX Search API enables filtering all N-PX filings published on the SEC EDGAR database since 2024. The API accepts search queries as JSON formatted payload and returns the matching N-PX filings in JSON format. The Voting Records API allows downloading the proxy voting records in structured JSON format for a specific filing by providing the filing's accession number.
851+
852+
```python
853+
from sec_api import FormNPXApi
854+
855+
formNpxApi = FormNPXApi("YOUR_API_KEY")
856+
857+
search_params = {
858+
"query": "cik:884546",
859+
"from": "0",
860+
"size": "1",
861+
"sort": [{"filedAt": {"order": "desc"}}],
862+
}
863+
864+
# get N-PX filing metadata: registrant type, investment company type,
865+
# series and class IDs, report type, period of report, and more
866+
response = formNpxApi.get_metadata(search_params)
867+
npx_filing_metadata = response["data"]
868+
869+
print(npx_filing_metadata)
870+
871+
# get proxy voting records: issuer name, CUSIP, meeting date, vote description,
872+
# vote categories, shares voted, how voted, management recommendation, and more
873+
accessionNo = npx_filing_metadata[0]["accessionNo"]
874+
response = formNpxApi.get_voting_records(accessionNo)
875+
voting_records = response["proxyVotingRecords"]
876+
877+
print(voting_records[0])
878+
```
879+
880+
> See the documentation for more details: https://sec-api.io/docs/form-npx-proxy-voting-records-api
881+
799882
## Form S-1/424B4 API
800883

801884
Access and find structured and standardized data extracted from S-1, F-1, and S-11 registration statements as well as 424B4 prospectus filings. The JSON data includes public offering prices, underwriting discounts, proceeds before expenses, security types being offered, underwriters (lead and co-managers), law firms, auditors, employee counts and management information (name, age, position).
@@ -1102,27 +1185,27 @@ print(response["data"])
11021185
}
11031186
```
11041187

1105-
## AAER Database API
1188+
## SEC Enforcement Actions Database API
11061189

1107-
Access and search the Accounting and Auditing Enforcement Releases (AAER) database. The database includes all AAERs filed from 1997 to present.
1190+
Access and search SEC enforcement actions published from 1997 to present. The database includes information about the parties involved in the action, nature of charges and complaints, penalty amounts, requested reliefs, violated rules and regulations, and more.
11081191

11091192
```python
1110-
from sec_api import AaerApi
1193+
from sec_api import SecEnforcementActionsApi
11111194

1112-
aaerApi = AaerApi("YOUR_API_KEY")
1195+
enforcementActionsApi = SecEnforcementActionsApi("YOUR_API_KEY")
11131196

1114-
query = {
1115-
"query": "dateTime:[2012-01-01 TO 2020-12-31]",
1197+
search_params = {
1198+
"query": "releasedAt:[2024-01-01 TO 2024-12-31]",
11161199
"from": "0",
11171200
"size": "50",
1118-
"sort": [{"dateTime": {"order": "desc"}}],
1201+
"sort": [{"releasedAt": {"order": "desc"}}],
11191202
}
11201203

1121-
response = aaerApi.get_data(query)
1204+
response = enforcementActionsApi.get_data(search_params)
11221205
print(response["data"])
11231206
```
11241207

1125-
> See the documentation for more details: https://sec-api.io/docs/aaer-database-api
1208+
> See the documentation for more details: https://sec-api.io/docs/sec-enforcement-actions-database-api
11261209
11271210
## SEC Litigation Releases Database API
11281211

@@ -1146,6 +1229,50 @@ print(response["data"])
11461229

11471230
> See the documentation for more details: https://sec-api.io/docs/sec-litigation-releases-database-api
11481231
1232+
## SEC Administrative Proceedings Database API
1233+
1234+
Access and search all 18,000+ administrative proceedings filed by the SEC from 1995 to present. The database includes information about respondents (name, CIK, ticker), type of proceeding, publication dates, complaints and orders, violated rules and regulations, disgorgement amounts, penalties, and more.
1235+
1236+
```python
1237+
from sec_api import SecAdministrativeProceedingsApi
1238+
1239+
adminProceedingsApi = SecAdministrativeProceedingsApi("YOUR_API_KEY")
1240+
1241+
searchRequest = {
1242+
"query": "releasedAt:[2024-01-01 TO 2024-12-31]",
1243+
"from": "0",
1244+
"size": "50",
1245+
"sort": [{"releasedAt": {"order": "desc"}}],
1246+
}
1247+
1248+
response = adminProceedingsApi.get_data(searchRequest)
1249+
print(response["data"])
1250+
```
1251+
1252+
> See the documentation for more details: https://sec-api.io/docs/sec-administrative-proceedings-database-api
1253+
1254+
## AAER Database API
1255+
1256+
Access and search the Accounting and Auditing Enforcement Releases (AAER) database. The database includes all AAERs filed from 1997 to present.
1257+
1258+
```python
1259+
from sec_api import AaerApi
1260+
1261+
aaerApi = AaerApi("YOUR_API_KEY")
1262+
1263+
query = {
1264+
"query": "dateTime:[2012-01-01 TO 2020-12-31]",
1265+
"from": "0",
1266+
"size": "50",
1267+
"sort": [{"dateTime": {"order": "desc"}}],
1268+
}
1269+
1270+
response = aaerApi.get_data(query)
1271+
print(response["data"])
1272+
```
1273+
1274+
> See the documentation for more details: https://sec-api.io/docs/aaer-database-api
1275+
11491276
## SRO Filings Database API
11501277

11511278
Access and search all SRO filings published from 1995 to present. The database includes more than 30,000 SRO filings from all types of organizations, including National Securities Exchanges (NYSE, NASDAQ, CBOE, etc.), Joint Industry Plans, FINRA, Futures Exchanges (CME, CBOT, etc.), and more.

0 commit comments

Comments
 (0)