Giter VIP home page Giter VIP logo

sec-api's Introduction

sec.gov EDGAR filings real-time API

  • 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

Getting Started

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

Command Line

In your command line, type

  1. npm install sec-api -g to install the package
  2. sec-api YOUR_API_KEY to connect to the stream. Replace YOUR_API_KEY with the API key provided on sec-api.io
  3. Done! You will filings printed in your command line as soon as they are published on SEC EDGAR.

Node.js

Type in your command line:

  1. mkdir my-project && cd my-project to create a new folder for your project.
  2. npm init -y to set up Node.js boilerplate.
  3. npm install sec-api to install the package.
  4. touch index.js to create a new file. Copy/paste the example code below into the file index.js. Replace YOUR_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));
  1. 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.

Python

  • 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()

React

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));
  }

  // ...
}

Response Format

  • companyName (string) - name of company, e.g. WALT DISNEY CO/ (0001001039) (Issuer)
  • cik (string) - CIK of company, e.g. 0001001039
  • type (string) - sec.gov form type, e.g 10-K
  • description (string) - description of filing, e.g. OWNERSHIP DOCUMENT
  • linkToFilingDetails (string) - link to all documents attached to the filing
  • linkToHtmlAnnouncement (string) - link to filing in HTML format
  • linkToXbrl (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

Example JSON Response

{
  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'
}

Contact

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

sec-api's People

Contributors

janlukasschroeder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.