Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sec-data-fetcher

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sec-data-fetcher

An npm library to fetch SEC data from all supported endpoints with rate limiting.

  • 1.0.1
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

SEC Data Fetcher

An npm library to fetch SEC data from all supported endpoints with rate limiting, written in TypeScript.

Features

  • CIK Lookup: Lookup Central Index Key (CIK) using a company's ticker symbol.
  • Company Data: Retrieve company submission data.
  • Reports: Fetch recent filings (e.g., 10-Q, 10-K, 8-K) after a specified date.
  • Company Facts: Get standardized fundamental data.
  • Parse Filings: Parse SEC filings from URLs or strings into structured objects.
  • Rate Limiting: Configurable rate limiting to comply with SEC guidelines.
  • TypeScript Support: Includes types for better TypeScript integration.
  • Customizable User-Agent: Set your own User-Agent string as required by the SEC.

Installation

npm install sec-data-fetcher

Usage

import { SECClient } from 'sec-data-fetcher';

// Initialize the SECClient with your User-Agent
const secClient = new SECClient({
  userAgent: 'Your Company Name contact@yourcompany.com',
});

(async () => {
  // Lookup CIK
  const cik = await secClient.cikLookup('AAPL');
  console.log('CIK:', cik);

  if (cik) {
    // Get Company Data
    const companyData = await secClient.getCompanyData(cik);
    console.log('Company Data:', companyData);

    // Get Reports
    const reports = await secClient.getReports(cik);
    console.log('Reports:', reports);

    // Parse a filing from URL
    if (reports.length > 0) {
      const filingUrl = `https://www.sec.gov/Archives/edgar/data/${parseInt(
        cik,
        10,
      )}/${reports[0].accessionNumber.replace(/-/g, '')}/${
        reports[0].primaryDocument
      }`;
      const filingObject = await secClient.getObjectFromUrl(filingUrl);
      console.log('Filing Object:', filingObject);
    }
  }
})();

API Reference

SECClient

Constructor

new SECClient(options: SECClientOptions)

Methods

  • cikLookup(ticker: string): Promise<string | null>
  • getCompanyData(cik: string): Promise
  • getReports(cik: string, after?: Date, forms?: string[]): Promise<Filing[]>
  • getCompanyFacts(cik: string): Promise
  • getObjectFromString(content: string): FilingObject
  • getObjectFromUrl(url: string): Promise

Notes

  • Ensure that you comply with the SEC’s Terms of Use.
  • All requests include the required headers (User-Agent, Accept-Encoding, and Host).
  • The library includes rate limiting to prevent exceeding the SEC’s request limits.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

MIT License. See the LICENSE file for details.

Disclaimer

This library is provided as-is and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Use this library responsibly and in compliance with the SEC’s Terms of Use.

Keywords

FAQs

Package last updated on 13 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc