Skip to content

Commit 9929a6b

Browse files
update
1 parent cd13a10 commit 9929a6b

7 files changed

Lines changed: 269 additions & 7 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
env
22
dist
33
build
4-
.idea
4+
.idea
5+
.pypirc

index.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
#!/usr/bin/python
2+
3+
import sys
14
import socketio
25
import pprint
36

47
pp = pprint.PrettyPrinter(indent=4)
58
sio = socketio.Client()
69

710
server_url = 'https://api.sec-api.io:3334'
8-
api_key = '7d2ea0730f7b2a1fff304b1e91abf634cd020a14e0ed0b6535f22f2443a18f30'
11+
api_key = str(sys.argv[1])
912
connection_string = server_url + '?apiKey=' + api_key
1013

1114

sec_api.egg-info/PKG-INFO

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
Metadata-Version: 2.1
2+
Name: sec-api
3+
Version: 0.0.1
4+
Summary: SEC EDGAR Filings API
5+
Home-page: https://github.com/janlukasschroeder/sec-api-python
6+
Author: SEC API
7+
Author-email: support@sec-api.io
8+
License: UNKNOWN
9+
Platform: UNKNOWN
10+
Classifier: Programming Language :: Python :: 3
11+
Classifier: License :: OSI Approved :: MIT License
12+
Classifier: Operating System :: OS Independent
13+
Description-Content-Type: text/markdown
14+
License-File: LICENSE
15+
16+
# sec.gov EDGAR filings real-time API
17+
18+
- Covers SEC Edgar filings for **over 8000** publicly listed companies, ETFs, hedge funds, mutual funds, and investors.
19+
- Every filing is **mapped to a CIK and ticker**.
20+
- **Over 150 form types** are supported, eg 10-Q, 10-K, 4, 8-K, 13-F and many more.
21+
[See the list of supported form types here.](https://sec-api.io/#list-of-sec-form-types)
22+
- The API returns a new filing as soon as it is published on SEC EDGAR.
23+
- **No XBRL/XML** needed - JSON formatted.
24+
- 13F holdings API included. Monitor all institutional ownerships in real-time.
25+
- Python, R, Java, C++, Excel scripts are supported through websockets
26+
- Client- and server-side JavaScript supported (Node.js, React, React Native, Angular, Vue, etc.)
27+
- Free API key available on [sec-api.io](https://sec-api.io)
28+
29+
The official documentation explains how to use the
30+
query API to filter historical filings: [sec-api.io/docs](https://sec-api.io/docs)
31+
32+
Data source: [sec.gov](https://www.sec.gov/edgar/searchedgar/companysearch.html)
33+
34+
# Getting Started
35+
36+
You can use the API in your command line, or develop your own application
37+
using the API as imported package. Both options are explained below.
38+
39+
40+
## Command Line
41+
42+
In your command line, type
43+
44+
1. `python -m pip install sec-api` to install the package
45+
2. `sec-api YOUR_API_KEY` to connect to the stream. Replace `YOUR_API_KEY` with
46+
the API key provided on [sec-api.io](https://sec-api.io)
47+
3. Done! You will see new filings printed in your command line
48+
as soon as they are published on SEC EDGAR.
49+
50+
51+
## Python
52+
53+
- Install the socket.io client: `pip install "python-socketio[client]"`
54+
- Run the example script below. Get your free API key on [sec-api.io](https://sec-api.io)
55+
and replace `YOUR_API_KEY` with it.
56+
57+
```python
58+
import socketio
59+
60+
sio = socketio.Client()
61+
62+
@sio.on('connect', namespace='/all-filings')
63+
def on_connect():
64+
print("Connected to https://api.sec-api.io:3334/all-filings")
65+
66+
@sio.on('filing', namespace='/all-filings')
67+
def on_filings(filing):
68+
print(filing)
69+
70+
sio.connect('https://api.sec-api.io:3334?apiKey=YOUR_API_KEY', namespaces=['/all-filings'])
71+
sio.wait()
72+
```
73+
74+
75+
76+
77+
# Response Format
78+
79+
- `accessionNo` (string) - Accession number of filing, e.g. 0000028917-20-000033
80+
- `cik` (string) - CIK of the filing issuer. Important: trailing `0` are removed.
81+
- `ticker` (string) - Ticker of company, e.g. AMOT. A ticker is not available when non-publicly traded companies report filings (e.g. form 4 reported by directors). Please contact us if you find filings that you think should have tickers (but don't).
82+
- `companyName` (string) - Name of company, e.g. Allied Motion Technologies Inc
83+
- `companyNameLong` (string) - Long version of company name including the filer type (Issuer, Filer, Reporting), e.g. ALLIED MOTION TECHNOLOGIES INC (0000046129) (Issuer)
84+
- `formType` (string) - sec.gov form type, e.g 10-K. [See the list of supported form types here.](https://sec-api.io/#list-of-sec-form-types)
85+
- `description` (string) - Description of the form, e.g. Statement of changes in beneficial ownership of securities
86+
- `linkToFilingDetails` (string) - Link to HTML, XML or PDF version of the filing.
87+
- `linkToTxt` (string) - Link to the plain text version of the filing. This file can be multiple MBs large.
88+
- `linkToHtml` (string) - Link to index page of the filing listing all exhibits and the original HTML file.
89+
- `linkToXbrl` (string, optional) - Link to XBRL version of the filing (if available).
90+
- `filedAt` (string) - The date (format: YYYY-MM-DD HH:mm:SS TZ) the filing was filed, eg 2019-12-06T14:41:26-05:00.
91+
- `id` (string) - Unique ID of the filing.
92+
- `entities` (array) - A list of all entities referred to in the filing. The first item in the array always represents the filing issuer. Each array element is an object with the following keys:
93+
- `companyName` (string) - Company name of the entity, e.g. DILLARD'S, INC. (Issuer)
94+
- `cik` (string) - CIK of the entity. Trailing 0 are not removed here, e.g. 0000028917
95+
- `irsNo` (string, optional) - IRS number of the entity, e.g. 710388071
96+
- `stateOfIncorporation` (string, optional) - State of incorporation of entity, e.g. AR
97+
- `fiscalYearEnd` (string, optional) - Fiscal year end of the entity, e.g. 0201
98+
- `sic` (string, optional) - SIC of the entity, e.g. 5311 Retail-Department Stores
99+
- `type` (string, optional) - Type of the filing being filed. Same as formType, e.g. 4
100+
- `act` (string, optional) - The SEC act pursuant to which the filing was filed, e.g. 34
101+
- `fileNo` (string, optional) - Filer number of the entity, e.g. 001-06140
102+
- `filmNo` (string, optional) - Film number of the entity, e.g. 20575664
103+
- `documentFormatFiles` (array) - An array listing all primary files of the filing. The first item of the array is always the filing itself. The last item of the array is always the TXT version of the filing. All other items can represent exhibits, press releases, PDF documents, presentations, graphics, XML files, and more. An array item is represented as follows:
104+
- `sequence` (string, optional) - The sequence number of the filing, e.g. 1
105+
- `description` (string, optional) - Description of the file, e.g. EXHIBIT 31.1
106+
- `documentUrl` (string) - URL to the file on SEC.gov
107+
- `type` (string, optional) - Type of the file, e.g. EX-32.1, GRAPHIC or 10-Q
108+
- `size` (string, optional) - Size of the file, e.g. 6627216
109+
- `dataFiles` (array) - List of data files (filing attachments, exhibits, XBRL files) attached to the filing.
110+
- `sequence` (string) - Sequence number of the file, e.g. 6
111+
- `description` (string) - Description of the file, e.g. XBRL INSTANCE DOCUMENT
112+
- `documentUrl` (string) - URL to the file on SEC.gov
113+
- `type` (string, optional) - Type of the file, e.g. EX-101.INS, EX-101.DEF or EX-101.PRE
114+
- `size` (string, optional) - Size of the file, e.g. 6627216
115+
116+
## Example JSON Response
117+
118+
```json
119+
{
120+
"id": "79ad9e452ea42402df4fe55c636191d6",
121+
"accessionNo": "0001213900-21-032169",
122+
"cik": "1824149",
123+
"ticker": "JOFF",
124+
"companyName": "JOFF Fintech Acquisition Corp.",
125+
"companyNameLong": "JOFF Fintech Acquisition Corp. (Filer)",
126+
"formType": "10-Q",
127+
"description": "Form 10-Q - Quarterly report [Sections 13 or 15(d)]",
128+
"filedAt": "2021-06-11T17:25:44-04:00",
129+
"linkToTxt": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169.txt",
130+
"linkToHtml": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169-index.htm",
131+
"linkToXbrl": "",
132+
"linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321_jofffintech.htm",
133+
"entities": [
134+
{
135+
"companyName": "JOFF Fintech Acquisition Corp. (Filer)",
136+
"cik": "1824149",
137+
"irsNo": "852863893",
138+
"stateOfIncorporation": "DE",
139+
"fiscalYearEnd": "1231",
140+
"type": "10-Q",
141+
"act": "34",
142+
"fileNo": "001-40005",
143+
"filmNo": "211012398",
144+
"sic": "6770 Blank Checks"
145+
}
146+
],
147+
"documentFormatFiles": [
148+
{
149+
"sequence": "1",
150+
"description": "QUARTERLY REPORT",
151+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321_jofffintech.htm",
152+
"type": "10-Q",
153+
"size": "274745"
154+
},
155+
{
156+
"sequence": "2",
157+
"description": "CERTIFICATION",
158+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex31-1_jofffintech.htm",
159+
"type": "EX-31.1",
160+
"size": "12209"
161+
},
162+
{
163+
"sequence": "3",
164+
"description": "CERTIFICATION",
165+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex31-2_jofffintech.htm",
166+
"type": "EX-31.2",
167+
"size": "12220"
168+
},
169+
{
170+
"sequence": "4",
171+
"description": "CERTIFICATION",
172+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex32-1_jofffintech.htm",
173+
"type": "EX-32.1",
174+
"size": "4603"
175+
},
176+
{
177+
"sequence": "5",
178+
"description": "CERTIFICATION",
179+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex32-2_jofffintech.htm",
180+
"type": "EX-32.2",
181+
"size": "4607"
182+
},
183+
{
184+
"sequence": " ",
185+
"description": "Complete submission text file",
186+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169.txt",
187+
"type": " ",
188+
"size": "2344339"
189+
}
190+
],
191+
"dataFiles": [
192+
{
193+
"sequence": "6",
194+
"description": "XBRL INSTANCE FILE",
195+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331.xml",
196+
"type": "EX-101.INS",
197+
"size": "248137"
198+
},
199+
{
200+
"sequence": "7",
201+
"description": "XBRL SCHEMA FILE",
202+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331.xsd",
203+
"type": "EX-101.SCH",
204+
"size": "43550"
205+
},
206+
{
207+
"sequence": "8",
208+
"description": "XBRL CALCULATION FILE",
209+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_cal.xml",
210+
"type": "EX-101.CAL",
211+
"size": "21259"
212+
},
213+
{
214+
"sequence": "9",
215+
"description": "XBRL DEFINITION FILE",
216+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_def.xml",
217+
"type": "EX-101.DEF",
218+
"size": "182722"
219+
},
220+
{
221+
"sequence": "10",
222+
"description": "XBRL LABEL FILE",
223+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_lab.xml",
224+
"type": "EX-101.LAB",
225+
"size": "309660"
226+
},
227+
{
228+
"sequence": "11",
229+
"description": "XBRL PRESENTATION FILE",
230+
"documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_pre.xml",
231+
"type": "EX-101.PRE",
232+
"size": "186873"
233+
}
234+
],
235+
"seriesAndClassesContractsInformation": [],
236+
"periodOfReport": "2021-03-31",
237+
"effectivenessDate": "2021-03-31"
238+
}
239+
```
240+
241+
# Contact
242+
243+
Let me know how I can improve the library or if you have any feature
244+
suggestions. I'm happy to implement them.
245+
246+
support@sec-api.io
247+
248+

sec_api.egg-info/SOURCES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
LICENSE
2+
README.md
3+
setup.py
4+
sec-api/__init__.py
5+
sec_api.egg-info/PKG-INFO
6+
sec_api.egg-info/SOURCES.txt
7+
sec_api.egg-info/dependency_links.txt
8+
sec_api.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

sec_api.egg-info/top_level.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sec-api

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import setuptools
1+
from setuptools import setup, find_packages
22

33
with open("README.md", "r") as fh:
44
long_description = fh.read()
55

6-
setuptools.setup(
6+
setup(
77
name="sec-api",
88
version="0.0.1",
99
author="SEC API",
1010
author_email="support@sec-api.io",
1111
description="SEC EDGAR Filings API",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
14-
url="https://github.com/pypa/sampleproject",
15-
packages=setuptools.find_packages(),
14+
url="https://github.com/janlukasschroeder/sec-api-python",
15+
packages=find_packages(),
1616
classifiers=[
1717
"Programming Language :: Python :: 3",
1818
"License :: OSI Approved :: MIT License",
1919
"Operating System :: OS Independent",
2020
],
21-
)
21+
)

0 commit comments

Comments
 (0)