Skip to content

Commit 34a7ae1

Browse files
added Form C API - Crowdfunding Campaigns
1 parent 8c181f4 commit 34a7ae1

File tree

5 files changed

+76
-1
lines changed

5 files changed

+76
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
**Security Offerings APIs**
3333

3434
- [Form S-1/424B4 API - Registration Statements and Prospectuses (IPOs, Debt/Warrants/... Offerings)](#form-s-1424b4-api)
35+
- [Form C API - Crowdfunding Offerings & Campaigns](#form-c-api---crowdfunding-campaigns)
3536
- [Form D API - Private Security Offerings](#form-d-api)
3637

3738
**Structured Material Event Data from Form 8-K**
@@ -901,6 +902,29 @@ print(response["data"])
901902

902903
> See the documentation for more details: https://sec-api.io/docs/form-s1-424b4-data-search-api
903904
905+
## Form C API - Crowdfunding Campaigns
906+
907+
Search and access Form C filings of crowdfunding campaigns from 2016 to present. The database includes information about the issuer (name, number of employees, total assets, etc), the target amount to be raised, the type of security offered, the deadline of the campaign, and more.
908+
909+
```python
910+
from sec_api import FormCApi
911+
912+
formCApi = FormCApi("YOUR_API_KEY")
913+
914+
search_params = {
915+
"query": "id:*",
916+
"from": "0",
917+
"size": "10",
918+
"sort": [{"filedAt": {"order": "desc"}}],
919+
}
920+
921+
response = formCApi.get_data(search_params)
922+
923+
print(response["data"])
924+
```
925+
926+
> See the documentation for more details: https://sec-api.io/docs/form-c-crowdfunding-api
927+
904928
## Form D API
905929

906930
Search and find Form D offering filings by any filing property, e.g. total offering amount, offerings filed by hedge funds, type of securities offered and many more.

examples.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
FormNPXApi,
1616
#
1717
Form_S1_424B4_Api,
18+
FormCApi,
1819
FormDApi,
1920
#
2021
Item_4_02_Api,
@@ -270,6 +271,24 @@
270271
print(response["filings"])
271272
# """
272273

274+
#
275+
# Form C API Example
276+
#
277+
"""
278+
formCApi = FormCApi("YOUR_API_KEY")
279+
280+
search_params = {
281+
"query": "id:*",
282+
"from": "0",
283+
"size": "10",
284+
"sort": [{"filedAt": {"order": "desc"}}],
285+
}
286+
287+
response = formCApi.get_data(search_params)
288+
289+
print(response["data"])
290+
# """
291+
273292
#
274293
# Form D API Example
275294
#

sec_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
# Offering APIs
2222
from sec_api.index import Form_S1_424B4_Api
23+
from sec_api.index import FormCApi
2324
from sec_api.index import FormDApi
2425

2526
# Investment Adviser API

sec_api/index.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#
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"
25+
form_C_endpoint = "https://api.sec-api.io/form-c"
2526
#
2627
form_8K_item_4_02_api_endpoint = "https://api.sec-api.io/form-8k"
2728
form_8K_item_x_api_endpoint = "https://api.sec-api.io/form-8k"
@@ -518,6 +519,36 @@ def get_data(self, query):
518519
handle_api_error(response)
519520

520521

522+
class FormCApi:
523+
"""
524+
Base class for Form C API
525+
https://sec-api.io/docs/form-c-crowdfunding-api
526+
"""
527+
528+
def __init__(self, api_key, proxies=None):
529+
self.api_key = api_key
530+
self.api_endpoint = form_C_endpoint + "?token=" + api_key
531+
self.proxies = proxies if proxies else {}
532+
533+
def get_data(self, query):
534+
response = {}
535+
536+
# use backoff strategy to handle "too many requests" error.
537+
for x in range(3):
538+
response = requests.post(
539+
self.api_endpoint, json=query, proxies=self.proxies
540+
)
541+
if response.status_code == 200:
542+
return response.json()
543+
elif response.status_code == 429:
544+
# wait 500 * (x + 1) milliseconds and try again
545+
time.sleep(0.5 * (x + 1))
546+
else:
547+
handle_api_error(response)
548+
else:
549+
handle_api_error(response)
550+
551+
521552
class FormDApi:
522553
"""
523554
Base class for Form D 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.28",
8+
version="1.0.29",
99
author="SEC API",
1010
author_email="support@sec-api.io",
1111
description="SEC EDGAR Filings API",

0 commit comments

Comments
 (0)