Skip to content

Instantly share code, notes, and snippets.

View janlukasschroeder's full-sized avatar
🎯
Focusing

Jan janlukasschroeder

🎯
Focusing
View GitHub Profile
@janlukasschroeder
janlukasschroeder / streaming-client-python.py
Last active August 21, 2021 10:22
SEC EDGAR Streaming Client - Python
import socketio
sio = socketio.Client()
@sio.on('connect', namespace='/all-filings')
def on_connect():
print("Connected to https://api.sec-api.io:3334/all-filings")
@sio.on('filing', namespace='/all-filings')
def on_filings(filing):
@janlukasschroeder
janlukasschroeder / streaming-client-node.js
Last active October 26, 2021 12:05
SEC EDGAR Streaming Client in Node.js
const { streamApi } = require('sec-api');
const client = streamApi.connect('YOUR_API_KEY');
client.on('filing', (filing) => console.log(filing));
@janlukasschroeder
janlukasschroeder / example-streaming-response.json
Last active September 28, 2021 19:46
Example response from SEC EDGAR streaming API
{
"id": "3f1416b68de0b25cfaa0bf21842d3691",
"accessionNo": "0001185348-20-000015",
"cik": "1185348",
"ticker": "PRAA",
"companyName": "PRA GROUP INC",
"companyNameLong": "PRA GROUP INC (Filer)",
"formType": "8-K",
"description": "Form 8-K - Current report",
"filedAt": "2020-06-09T08:05:40-04:00",
@janlukasschroeder
janlukasschroeder / sec-edgar-query-api-response-example.json
Last active January 24, 2022 10:39
SEC EDGAR Query API - Response Example 1
{
"total": {
"value": 10000,
"relation": "gte"
},
"filings": [
{
"id": "9bb018bb35b26df92204a0afba52c30a",
"accessionNo": "0001437749-20-002201",
"cik": "924383",
@janlukasschroeder
janlukasschroeder / sec-api.py
Last active June 12, 2022 13:36
SEC Filings API - Python 3.x Example
from sec_api import QueryApi
queryApi = QueryApi(api_key="YOUR_API_KEY")
query = {
"query": { "query_string": {
"query": "ticker:TSLA AND filedAt:[2020-01-01 TO 2020-12-31] AND formType:\"10-Q\"",
"time_zone": "America/New_York"
} },
"from": "0",
@janlukasschroeder
janlukasschroeder / sec-filings-api-notebook.ipynb
Last active September 8, 2022 14:17
sec-filings-api-notebook.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@janlukasschroeder
janlukasschroeder / sec-filings-api-curl.sh
Last active June 15, 2021 07:13
SEC EDGAR API - cURL Example
curl -XPOST -H "Content-type: application/json" -d '{
"query": {
"query_string": {
"query": "cik:320193 AND filedAt:{2016-01-01 TO 2016-12-31} AND formType:\"10-Q\""
}
},
"from": "0",
"size": "10",
"sort": [{ "filedAt": { "order": "desc" } }]
}' 'https://api.sec-api.io?token=YOUR_API_KEY'
@janlukasschroeder
janlukasschroeder / sec-filings-api-json.json
Created August 24, 2019 03:25
SEC EDGAR Filings API - JSON Payload Example
{
"query": {
"query_string": {
"query": "cik:320193 AND filedAt:{2016-01-01 TO 2016-12-31} AND formType:\"10-Q\""
}
},
"from": "0",
"size": "10",
"sort": [
{
@janlukasschroeder
janlukasschroeder / sec-filings-api-response-example.json
Created August 24, 2019 03:26
SEC EDGAR Filings API - Response Example
{
"total": 3,
"filings": [
{
"cik": "320193",
"ticker": "AAPL",
"companyName": "APPLE INC",
"formType": "10-Q",
"filedAt": "2016-07-27",
"linkToTxt": "https://www.sec.gov/...16-017809.txt",
@janlukasschroeder
janlukasschroeder / requirements.txt
Last active February 12, 2022 05:18
SEC EDGAR Filings API - Live Feed Example.
python-socketio[client]