Skip to content

Commit ce591f9

Browse files
added APIs for Regulation A filings: Form 1-A, Form 1-K, Form 1-Z
1 parent 34a7ae1 commit ce591f9

File tree

6 files changed

+306
-4
lines changed

6 files changed

+306
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ build
66
.pypirc
77
sec_api.egg-info
88
deploy.sh
9-
sec_api/__pycache__
9+
sec_api/__pycache__
10+
requirements.txt

README.md

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# SEC API - A SEC.gov EDGAR Filings Query & Real-Time Stream API
1+
# SEC API - Access SEC and EDGAR Data with Python
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. It includes:
3+
[![Downloads](https://pepy.tech/badge/sec-api)](https://pepy.tech/project/sec-api) [![Documentation](https://img.shields.io/badge/Documentation-sec--api.io-blue)](https://sec-api.io/docs)
4+
5+
**sec-api** is a Python package for searching and accessing the entire SEC EDGAR filings corpus, providing access to petabytes of regulatory data from public and private companies, insiders (directors, board members, etc.), funds (ETFs, hedge funds, etc.), financial advisors, business development companies, and more. It includes:
46

57
**EDGAR Filing Search & Download APIs**
68

@@ -34,6 +36,7 @@
3436
- [Form S-1/424B4 API - Registration Statements and Prospectuses (IPOs, Debt/Warrants/... Offerings)](#form-s-1424b4-api)
3537
- [Form C API - Crowdfunding Offerings & Campaigns](#form-c-api---crowdfunding-campaigns)
3638
- [Form D API - Private Security Offerings](#form-d-api)
39+
- [Regulation A APIs - Offering Statements by Small Companies (Form 1-A, Form 1-K, Form 1-Z)](#regulation-a-apis)
3740

3841
**Structured Material Event Data from Form 8-K**
3942

@@ -948,6 +951,98 @@ print(response["offerings"])
948951

949952
> See the documentation for more details: https://sec-api.io/docs/form-d-xml-json-api
950953
954+
## Regulation A APIs
955+
956+
Access and search all Regulation A offering statements (Tier 1 and 2) filed with the SEC from 2015 to present. The database includes Form 1-A (offerings), Form 1-K (annual reports) and Form 1-Z (exit report) filings as well as withdrawls and amendments. Information about the issuer (total assets, debt, etc.), offering (type, total amount, offering price, auditor, etc.), and more is available.
957+
958+
### Search All Regulation A Filings
959+
960+
```python
961+
from sec_api import RegASearchAllApi
962+
963+
regASearchAllApi = RegASearchAllApi("YOUR_API_KEY")
964+
965+
search_params = {
966+
"query": "filedAt:[2024-01-01 TO 2024-12-31]",
967+
"from": "0", # increase by 50 to fetch the next 50 results
968+
"size": "50",
969+
"sort": [{"filedAt": {"order": "desc"}}],
970+
}
971+
972+
response = regASearchAllApi.get_data(search_params)
973+
offeringStatement = response["data"][0]
974+
975+
print(offeringStatement)
976+
```
977+
978+
> See the documentation for more details: https://sec-api.io/docs/reg-a-offering-statements-api
979+
980+
### Form 1-A API
981+
982+
```python
983+
from sec_api import Form1AApi
984+
985+
form1AApi = Form1AApi("YOUR_API_KEY")
986+
987+
search_params = {
988+
"query": "summaryInfo.indicateTier1Tier2Offering:Tier1",
989+
"from": "0",
990+
"size": "50",
991+
"sort": [{"filedAt": {"order": "desc"}}],
992+
}
993+
994+
response = form1AApi.get_data(search_params)
995+
form1A = response["data"][0]
996+
997+
print(form1A)
998+
```
999+
1000+
> See the documentation for more details: https://sec-api.io/docs/reg-a-offering-statements-api
1001+
1002+
### Form 1-K API
1003+
1004+
```python
1005+
from sec_api import Form1KApi
1006+
1007+
form1KApi = Form1KApi("YOUR_API_KEY")
1008+
1009+
search_params = {
1010+
"query": "fileNo:24R-00472",
1011+
"from": "0",
1012+
"size": "50",
1013+
"sort": [{"filedAt": {"order": "desc"}}],
1014+
}
1015+
1016+
response = form1KApi.get_data(search_params)
1017+
form1Ks = response["data"]
1018+
1019+
print(form1Ks)
1020+
```
1021+
1022+
> See the documentation for more details: https://sec-api.io/docs/reg-a-offering-statements-api
1023+
1024+
### Form 1-Z API
1025+
1026+
```python
1027+
from sec_api import Form1ZApi
1028+
1029+
form1ZApi = Form1ZApi("YOUR_API_KEY")
1030+
1031+
search_params = {
1032+
"query": "cik:*",
1033+
"from": "0",
1034+
"size": "50",
1035+
"sort": [{"filedAt": {"order": "desc"}}],
1036+
}
1037+
1038+
response = form1ZApi.get_data(search_params)
1039+
form1Zs = response["data"]
1040+
1041+
print(form1Zs)
1042+
```
1043+
1044+
> See the documentation for more details: https://sec-api.io/docs/reg-a-offering-statements-api
1045+
9511046
## Structured Data of Material Event Disclosures under Form 8-K
9521047

9531048
### Auditor and Accountant Changes (Item 4.01)

examples.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
Form_S1_424B4_Api,
1818
FormCApi,
1919
FormDApi,
20+
RegASearchAllApi,
21+
Form1AApi,
22+
Form1KApi,
23+
Form1ZApi,
2024
#
2125
Item_4_02_Api,
2226
Form_8K_Item_X_Api,
@@ -307,6 +311,88 @@
307311
print(response["offerings"])
308312
# """
309313

314+
#
315+
# Regulation A Search All API Example
316+
#
317+
"""
318+
regASearchAllApi = RegASearchAllApi("YOUR_API_KEY")
319+
320+
search_params = {
321+
"query": "filedAt:[2024-01-01 TO 2024-12-31]",
322+
"from": "0", # increase by 50 to fetch the next 50 results
323+
"size": "50",
324+
"sort": [{"filedAt": {"order": "desc"}}],
325+
}
326+
327+
response = regASearchAllApi.get_data(search_params)
328+
offeringStatement = response["data"][0]
329+
330+
print(offeringStatement)
331+
# """
332+
333+
#
334+
# Form 1-A API
335+
#
336+
"""
337+
from sec_api import Form1AApi
338+
339+
form1AApi = Form1AApi("YOUR_API_KEY")
340+
341+
search_params = {
342+
"query": "summaryInfo.indicateTier1Tier2Offering:Tier1",
343+
"from": "0",
344+
"size": "50",
345+
"sort": [{"filedAt": {"order": "desc"}}],
346+
}
347+
348+
response = form1AApi.get_data(search_params)
349+
form1A = response["data"][0]
350+
351+
print(form1A)
352+
# """
353+
354+
#
355+
# Form 1-K API
356+
#
357+
"""
358+
from sec_api import Form1KApi
359+
360+
form1KApi = Form1KApi("YOUR_API_KEY")
361+
362+
search_params = {
363+
"query": "fileNo:24R-00472",
364+
"from": "0",
365+
"size": "50",
366+
"sort": [{"filedAt": {"order": "desc"}}],
367+
}
368+
369+
response = form1KApi.get_data(search_params)
370+
form1Ks = response["data"]
371+
372+
print(form1Ks)
373+
# """
374+
375+
#
376+
# Form 1-Z API
377+
#
378+
"""
379+
from sec_api import Form1ZApi
380+
381+
form1ZApi = Form1ZApi("YOUR_API_KEY")
382+
383+
search_params = {
384+
"query": "cik:*",
385+
"from": "0",
386+
"size": "50",
387+
"sort": [{"filedAt": {"order": "desc"}}],
388+
}
389+
390+
response = form1ZApi.get_data(search_params)
391+
form1Zs = response["data"]
392+
393+
print(form1Zs)
394+
# """
395+
310396

311397
#
312398
# Form ADV API Example

sec_api/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
from sec_api.index import Form_S1_424B4_Api
2323
from sec_api.index import FormCApi
2424
from sec_api.index import FormDApi
25+
from sec_api.index import RegASearchAllApi
26+
from sec_api.index import Form1AApi
27+
from sec_api.index import Form1KApi
28+
from sec_api.index import Form1ZApi
2529

2630
# Investment Adviser API
2731
from sec_api.index import FormAdvApi

sec_api/index.py

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
form_S1_424B4_endpoint = "https://api.sec-api.io/form-s1-424b4"
2424
form_d_api_endpoint = "https://api.sec-api.io/form-d"
2525
form_C_endpoint = "https://api.sec-api.io/form-c"
26+
reg_A_search_all_endpoint = "https://api.sec-api.io/reg-a/search"
27+
form_1A_endpoint = "https://api.sec-api.io/reg-a/form-1a"
28+
form_1K_endpoint = "https://api.sec-api.io/reg-a/form-1k"
29+
form_1Z_endpoint = "https://api.sec-api.io/reg-a/form-1z"
2630
#
2731
form_8K_item_4_02_api_endpoint = "https://api.sec-api.io/form-8k"
2832
form_8K_item_x_api_endpoint = "https://api.sec-api.io/form-8k"
@@ -578,6 +582,118 @@ def get_data(self, query):
578582
handle_api_error(response)
579583

580584

585+
class RegASearchAllApi:
586+
"""
587+
Base class for Regulation A Search All API
588+
https://sec-api.io/docs/reg-a-offering-statements-api#search-api-endpoint
589+
"""
590+
591+
def __init__(self, api_key, proxies=None):
592+
self.api_key = api_key
593+
self.api_endpoint = reg_A_search_all_endpoint + "?token=" + api_key
594+
self.proxies = proxies if proxies else {}
595+
596+
def get_data(self, query):
597+
response = {}
598+
599+
for x in range(3):
600+
response = requests.post(
601+
self.api_endpoint, json=query, proxies=self.proxies
602+
)
603+
if response.status_code == 200:
604+
return response.json()
605+
elif response.status_code == 429:
606+
time.sleep(0.5 * (x + 1))
607+
else:
608+
handle_api_error(response)
609+
else:
610+
handle_api_error(response)
611+
612+
613+
class Form1AApi:
614+
"""
615+
Base class for Form 1-A API
616+
https://sec-api.io/docs/reg-a-offering-statements-api#form-1-a-offering-statements-api
617+
"""
618+
619+
def __init__(self, api_key, proxies=None):
620+
self.api_key = api_key
621+
self.api_endpoint = form_1A_endpoint + "?token=" + api_key
622+
self.proxies = proxies if proxies else {}
623+
624+
def get_data(self, query):
625+
response = {}
626+
627+
for x in range(3):
628+
response = requests.post(
629+
self.api_endpoint, json=query, proxies=self.proxies
630+
)
631+
if response.status_code == 200:
632+
return response.json()
633+
elif response.status_code == 429:
634+
time.sleep(0.5 * (x + 1))
635+
else:
636+
handle_api_error(response)
637+
else:
638+
handle_api_error(response)
639+
640+
641+
class Form1KApi:
642+
"""
643+
Base class for Form 1-K API
644+
https://sec-api.io/docs/reg-a-offering-statements-api#form-1-k-annual-reports-api
645+
"""
646+
647+
def __init__(self, api_key, proxies=None):
648+
self.api_key = api_key
649+
self.api_endpoint = form_1K_endpoint + "?token=" + api_key
650+
self.proxies = proxies if proxies else {}
651+
652+
def get_data(self, query):
653+
response = {}
654+
655+
for x in range(3):
656+
response = requests.post(
657+
self.api_endpoint, json=query, proxies=self.proxies
658+
)
659+
if response.status_code == 200:
660+
return response.json()
661+
elif response.status_code == 429:
662+
time.sleep(0.5 * (x + 1))
663+
else:
664+
handle_api_error(response)
665+
else:
666+
handle_api_error(response)
667+
668+
669+
class Form1ZApi:
670+
"""
671+
Base class for Form 1-Z API
672+
https://sec-api.io/docs/reg-a-offering-statements-api#form-1-z-exit-reports-api
673+
"""
674+
675+
def __init__(self, api_key, proxies=None):
676+
self.api_key = api_key
677+
self.api_endpoint = form_1Z_endpoint + "?token=" + api_key
678+
self.proxies = proxies if proxies else {}
679+
680+
def get_data(self, query):
681+
response = {}
682+
683+
for x in range(3):
684+
response = requests.post(
685+
self.api_endpoint, json=query, proxies=self.proxies
686+
)
687+
if response.status_code == 200:
688+
return response.json()
689+
elif response.status_code == 429:
690+
time.sleep(0.5 * (x + 1))
691+
else:
692+
handle_api_error(response)
693+
else:
694+
handle_api_error(response)
695+
696+
581697
class FormAdvApi:
582698
"""
583699
Base class for Form ADV API

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="sec-api",
8-
version="1.0.29",
8+
version="1.0.30",
99
author="SEC API",
1010
author_email="support@sec-api.io",
1111
description="SEC EDGAR Filings API",

0 commit comments

Comments
 (0)