- Over 8000 publicly listed companies, ETFs, mutual funds, and investors are covered.
- Every filing is mapped to a CIK and ticker.
- Over 150 form types are supported, eg 10-Q, 10-K, 4, 8-K, 13-F and many more. See the list of supported form types here.
- The API returns a new filing as soon as it is published on SEC EDGAR.
- No XBRL/XML needed - JSON formatted.
- Python, R, Java, C++, Excel scripts are supported through websockets
- Client- and server-side JavaScript supported (Node.js, React, React Native, Angular, Vue, etc.)
- Free API key available on sec-api.io
The official documentation explains how to use the query API to filter historical filings: sec-api.io/docs
Data source: sec.gov
You can use the API in your command line, or develop your own application using the API as imported package. Both options are explained below.
Before you start:
- Install Node.js if you haven't already. On Mac in the command line type
brew install node
. - Get your free API key here: sec-api.io
In your command line, type
npm install sec-api -g
to install the packagesec-api YOUR_API_KEY
to connect to the stream. ReplaceYOUR_API_KEY
with the API key provided on sec-api.io- Done! You will filings printed in your command line as soon as they are published on SEC EDGAR.
Type in your command line:
mkdir my-project && cd my-project
to create a new folder for your project.npm init -y
to set up Node.js boilerplate.npm install sec-api
to install the package.touch index.js
to create a new file. Copy/paste the example code below into the file index.js. ReplaceYOUR_API_KEY
with the API key provided on sec-api.io
const api = require('sec-api')('YOUR_API_KEY');
api.on('filing', filing => console.log(filing));
node index.js
to start listening for new filings. New filings are printed in your console as soon as they are published on SEC EDGAR.
- Install the socket.io client:
pip install "python-socketio[client]"
- Run the example script below. Get your free API key on sec-api.io
and replace
YOUR_API_KEY
with it.
import socketio
sio = socketio.Client()
@sio.on('connect', namespace='/all-filings')
def on_connect():
print("Connected to https://socket.sec-api.io/all-filings")
@sio.on('filing', namespace='/all-filings')
def on_filings(filing):
print(filing)
sio.connect('https://socket.sec-api.io?apiKey=YOUR_API_KEY', namespaces=['/all-filings'])
sio.wait()
Live Demo: https://codesandbox.io/s/01xqz2ml9l
import api from 'sec-api';
class Filings extends React.Component {
componentDidMount() {
const socket = api('YOUR_API_KEY');
socket.on('filing', filing => console.log(filing));
}
// ...
}
companyName
(string) - name of company, e.g. WALT DISNEY CO/ (0001001039) (Issuer)cik
(string) - CIK of company, e.g. 0001001039type
(string) - sec.gov form type, e.g 10-Kdescription
(string) - description of filing, e.g. OWNERSHIP DOCUMENTlinkToFilingDetails
(string) - link to all documents attached to the filinglinkToHtmlAnnouncement
(string) - link to filing in HTML formatlinkToXbrl
(string) - link to XBRL file (in XML format) of filing. Is not set, if no XBRL file is attached to the original filing on EDGAR.announcedAt
(string) - ISO 8601 conform filing date and time, e.g. 2018-12-21T20:02:07-05:00
{
companyName: 'WALT DISNEY CO/ (0001001039) (Issuer)',
cik: '0001001039',
type: '4',
description: 'FORM 4',
linkToFilingDetails: 'https://www.sec.gov/Archives/edgar/data/1001039/000100103918000235/0001001039-18-000235-index.htm',
linkToHtmlAnnouncement: 'https://www.sec.gov/Archives/edgar/data/1001039/000100103918000235/xslF345X03/wf-form4_154544051056009.xml',
linkToXbrl: 'https://www.sec.gov/Archives/edgar/data/1001039/000100103918000235/wf-form4_154544051056009.xml',
announcedAt: '2018-12-21T20:02:07-05:00'
}
Let me know how I can improve the library or if you have any feature suggestions. I'm happy to implement them.
Just open a new issue on github here: https://github.com/janlukasschroeder/sec-api/issues