npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sec-api

v4.0.0

Published

SEC-API.io JavaScript Library

Readme

SEC-API.io JavaScript API Library

sec-api is a JavaScript library for accessing the complete EDGAR database, including over 20 million SEC filings from 1993/94 to the present and more than 100 million exhibits and attachments.

Download filings and related documents, such as complete submission files, index pages, SGML headers, XML and XBRL files, PDFs, and more, at up to 20 requests per second, with no API key required.

The full API documentation is available at sec-api.io/docs.

Quick Start

npm install sec-api

Download EDGAR Filings Free of Charge

const { downloadApi } = require('sec-api');

// optional, only needed for higher rate limits.
// downloadApi.setApiKey('YOUR_API_KEY');

const filingUrl =
  'https://www.sec.gov/Archives/edgar/data/1318605/000162828025045968/tsla-20250930.htm';

const data = await downloadApi.getFile(filingUrl);

console.log(data.slice(0, 1000));

Feature Overview

EDGAR Filing Search & Download APIs

Converter & Extractor APIs

Investment Advisers

Ownership Data APIs

Investment Companies

Security Offerings APIs

Structured Material Event Data from Form 8-K

Public Company Data

Enforcement Actions, Proceedings, AAERs & SRO Filings

Other APIs

SEC EDGAR Filings Query API

The Query API allows searching and filtering all 20 million filings and 100 million exhibits published on the SEC EDGAR database since 1993 to present, with new filings being added in 300 milliseconds after their publication on EDGAR.

const { queryApi } = require('sec-api');

queryApi.setApiKey('YOUR_API_KEY');

const query = {
  query: 'formType:"10-Q"', // get most recent 10-Q filings
  from: '0', // used for pagination. set to 50 to retrieve the next 50 metadata objects.
  size: '50', // number of results per response
  sort: [{ filedAt: { order: 'desc' } }], // sort result by filedAt
};

const filings = await queryApi.getFilings(rawQuery);
{
  "total": {  "value": 47,  "relation": "eq" },
  "filings": [
    {
      "id": "3ba530142cd52e76b7e15cc9000d2c33",
      "ticker": "TSLA",
      "formType": "10-Q",
      "description": "Form 10-Q - Quarterly report [Sections 13 or 15(d)]",
      "accessionNo": "0001628280-25-045968",
      "cik": "1318605",
      "companyNameLong": "Tesla, Inc. (Filer)",
      "companyName": "Tesla, Inc.",
      "filedAt": "2025-10-22T21:08:43-04:00",
      "periodOfReport": "2025-09-30",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1318605/000162828025045968/0001628280-25-045968-index.htm",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1318605/000162828025045968/tsla-20250930.htm",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1318605/000162828025045968/0001628280-25-045968.txt",
      "entities": [
        {
          "fiscalYearEnd": "1231",
          "stateOfIncorporation": "TX",
          "act": "34",
          "cik": "1318605",
          "fileNo": "001-34756",
          "irsNo": "912197729",
          "companyName": "Tesla, Inc. (Filer)",
          "type": "10-Q",
          "sic": "3711 Motor Vehicles & Passenger Car Bodies",
          "filmNo": "251411222",
          "undefined": "04 Manufacturing)"
        }
      ],
      "documentFormatFiles": [
        {
          "sequence": "1",
          "size": "1573631",
          "documentUrl": "https://www.sec.gov/ix?doc=/Archives/edgar/data/1318605/000162828025045968/tsla-20250930.htm",
          "description": "10-Q",
          "type": "10-Q"
        },
        // ... more files
      ],
      "dataFiles": [
        {
          "sequence": "5",
          "size": "54524",
          "documentUrl": "https://www.sec.gov/Archives/edgar/data/1318605/000162828025045968/tsla-20250930.xsd",
          "description": "XBRL TAXONOMY EXTENSION SCHEMA DOCUMENT",
          "type": "EX-101.SCH"
        },
        // ... more files
      ],
    },
  ]
}

See the documentation for more details: https://sec-api.io/docs/query-api

Full-Text Search API

The SEC Filing Full-Text Search API enables searches across the full text of all EDGAR filings submitted since 2001. Each search scans the entire filing content, including all attachments, such as exhibits.

The following example returns all 8-K and 10-Q filings and their exhibits, filed between 01-01-2021 and 14-06-2021, that include the exact phrase "LPCN 1154".

const { fullTextSearchApi } = require('sec-api');

fullTextSearchApi.setApiKey('YOUR_API_KEY');

const query = {
  query: '"LPCN 1154"',
  formTypes: ['8-K', '10-Q'],
  startDate: '2021-01-01',
  endDate: '2021-06-14',
};

const filings = await fullTextSearchApi.getFilings(rawQuery);

See the documentation for more details: https://sec-api.io/docs/full-text-search-api

Filings Real-Time Stream API

The Stream API provides a real-time feed of the latest filings submitted to the SEC EDGAR database via a WebSocket connection. This push-based technology ensures immediate delivery of metadata for each new filing as it becomes publicly available.

const WebSocket = require('ws');

const API_KEY = 'YOUR_API'; // replace this with your actual API key
const STREAM_API_URL = 'wss://stream.sec-api.io?apiKey=' + API_KEY;

const ws = new WebSocket(STREAM_API_URL);

ws.on('open', () => console.log('✅ Connected to:', STREAM_API_URL));
ws.on('close', () => console.log('Connection closed'));
ws.on('error', (err) => console.log('Error:', err.message));

ws.on('message', (message) => {
  const filings = JSON.parse(message.toString());
  filings.forEach((filing) => {
    console.log(
      filing.id,
      filing.cik,
      filing.formType,
      filing.filedAt,
      filing.linkToFilingDetails,
    );
  });
});

See the documentation for more details: https://sec-api.io/docs/stream-api

Filing & Exhibit Download API

On the free plan, you can download up to 20 SEC filings per second without an API key. Paid plans allow for higher throughput—up to 60,000 filings within a 5-minute window. Access is provided to all 20+ million EDGAR filings dating back to 1993, including over 100 million attachments and exhibits such as Exhibit 99, complete submission files, SGML headers, and more.

const { downloadApi } = require('sec-api');

downloadApi.setApiKey('YOUR_API_KEY');

const filingUrl =
  'https://www.sec.gov/Archives/edgar/data/1841925/000121390021032758/ea142795-8k_indiesemic.htm';

const filingContent = await downloadApi.getFile(filingUrl);

See the documentation for more details: https://sec-api.io/docs/sec-filings-render-api

XBRL-To-JSON Converter API

Parse and standardize any XBRL data and convert it to standardized JSON format in seconds without coding. Extract financial statements from annual and quarterly reports (10-K, 10-Q, 20-F, 40-F), offerings such as S-1 filings, and post-effective amendements for registration statements (POS AM), accounting policies and footnotes, risk-return summaries of mutual fund and ETF prospectuses (485BPOS) and general information from event filings (8-K). All XBRL-supported filing types can be converterd.

Income Statement Item Example

{
  "StatementsOfIncome": {
    "RevenueFromContractWithCustomerExcludingAssessedTax": [
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "startDate": "2019-09-29",
          "endDate": "2020-09-26"
        },
        "value": "274515000000"
      },
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "startDate": "2018-09-30",
          "endDate": "2019-09-28"
        },
        "value": "260174000000"
      }
    ]
  }
}

Usage

Convert XBRL filings to JSON using one of the following three input methods:

  1. htmUrl - URL of the filing’s HTML page (typically ending in .htm). Example: https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231.htm
  2. xbrlUrl - Direct URL to the XBRL instance document (ending in .xml). This URL is available in the dataFiles array returned by the query API. Look for an item with the description "EXTRACTED XBRL INSTANCE DOCUMENT" or similar. Example: https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231_htm.xml
  3. accessionNo - SEC accession number of the filing (e.g., 0001564590-21-004599).
const { xbrlApi } = secApi;

xbrlApi.setApiKey('YOUR_API_KEY');

// 10-K HTM File URL example
const xbrlJson1 = await xbrlApi.xbrlToJson({
  htmUrl:
    'https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926.htm',
});

// 10-K XBRL File URL Example
const xbrlJson2 = await xbrlApi.xbrlToJson({
  xbrlUrl:
    'https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926_htm.xml',
});

// 10-K Accession Number Example
const xbrlJson3 = await xbrlApi.xbrlToJson({
  accessionNo: '0000320193-20-000096',
});
{
  "CoverPage": {
    "DocumentPeriodEndDate": "2020-09-26",
    "EntityRegistrantName": "Apple Inc.",
    "EntityIncorporationStateCountryCode": "CA",
    "EntityTaxIdentificationNumber": "94-2404110",
    "EntityAddressAddressLine1": "One Apple Park Way",
    "EntityAddressCityOrTown": "Cupertino",
    "EntityAddressStateOrProvince": "CA",
    "EntityAddressPostalZipCode": "95014",
    "CityAreaCode": "408",
    "LocalPhoneNumber": "996-1010",
    "TradingSymbol": "AAPL",
    "EntityPublicFloat": {
      "decimals": "-6",
      "unitRef": "usd",
      "period": {
        "instant": "2020-03-27"
      },
      "value": "1070633000000"
    },
    "EntityCommonStockSharesOutstanding": {
      "decimals": "-3",
      "unitRef": "shares",
      "period": {
        "instant": "2020-10-16"
      },
      "value": "17001802000"
    },
    "DocumentFiscalPeriodFocus": "FY",
    "CurrentFiscalYearEndDate": "--09-26"
  },
  "StatementsOfIncome": {
    "RevenueFromContractWithCustomerExcludingAssessedTax": [
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "startDate": "2019-09-29",
          "endDate": "2020-09-26"
        },
        "segment": {
          "dimension": "srt:ProductOrServiceAxis",
          "value": "us-gaap:ProductMember"
        },
        "value": "220747000000"
      },
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "startDate": "2018-09-30",
          "endDate": "2019-09-28"
        },
        "segment": {
          "dimension": "srt:ProductOrServiceAxis",
          "value": "us-gaap:ProductMember"
        },
        "value": "213883000000"
      }
    ]
  },
  "BalanceSheets": {
    "CashAndCashEquivalentsAtCarryingValue": [
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "instant": "2020-09-26"
        },
        "value": "38016000000"
      },
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "instant": "2019-09-28"
        },
        "value": "48844000000"
      },
      {
        "decimals": "-6",
        "unitRef": "usd",
        "period": {
          "instant": "2020-09-26"
        },
        "segment": {
          "dimension": "us-gaap:FinancialInstrumentAxis",
          "value": "us-gaap:CashMember"
        },
        "value": "17773000000"
      }
    ]
  }
}

See the documentation for more details: https://sec-api.io/docs/xbrl-to-json-converter-api

10-K/10-Q/8-K Section Extractor API

The Extractor API extracts any text section from 10-Q, 10-K and 8-K SEC filings, and returns the extracted content in cleaned and standardized text or HTML format.

Supported sections:

  • 1 - Business
  • 1A - Risk Factors
  • 1B - Unresolved Staff Comments
  • 1C - Cybersecurity
  • 2 - Properties
  • 3 - Legal Proceedings
  • 4 - Mine Safety Disclosures
  • 5 - Market for Registrant’s Common Equity, Related Stockholder Matters and Issuer Purchases of Equity Securities
  • 6 - Selected Financial Data (prior to February 2021)
  • 7 - Management’s Discussion and Analysis of Financial Condition and Results of Operations
  • 7A - Quantitative and Qualitative Disclosures about Market Risk
  • 8 - Financial Statements and Supplementary Data
  • 9 - Changes in and Disagreements with Accountants on Accounting and Financial Disclosure
  • 9A - Controls and Procedures
  • 9B - Other Information
  • 10 - Directors, Executive Officers and Corporate Governance
  • 11 - Executive Compensation
  • 12 - Security Ownership of Certain Beneficial Owners and Management and Related Stockholder Matters
  • 13 - Certain Relationships and Related Transactions, and Director Independence
  • 14 - Principal Accountant Fees and Services
  • 15 - Exhibits and Financial Statement Schedules
  • Part 1:

    • 1 - Financial Statements
    • 2 - Management’s Discussion and Analysis of Financial Condition and Results of Operations
    • 3 - Quantitative and Qualitative Disclosures About Market Risk
    • 4 - Controls and Procedures
  • Part 2:

    • 1 - Legal Proceedings
    • 1A - Risk Factors
    • 2 - Unregistered Sales of Equity Securities and Use of Proceeds
    • 3 - Defaults Upon Senior Securities
    • 4 - Mine Safety Disclosures
    • 5 - Other Information
    • 6 - Exhibits
  • 1.01: Entry into a Material Definitive Agreement
  • 1.02: Termination of a Material Definitive Agreement
  • 1.03: Bankruptcy or Receivership
  • 1.04: Mine Safety - Reporting of Shutdowns and Patterns of Violations
  • 1.05: Material Cybersecurity Incidents (introduced in 2023)
  • 2.01: Completion of Acquisition or Disposition of Assets
  • 2.02: Results of Operations and Financial Condition
  • 2.03: Creation of a Direct Financial Obligation or an Obligation under an Off-Balance Sheet Arrangement of a Registrant
  • 2.04: Triggering Events That Accelerate or Increase a Direct Financial Obligation or an Obligation under an Off-Balance Sheet Arrangement
  • 2.05: Cost Associated with Exit or Disposal Activities
  • 2.06: Material Impairments
  • 3.01: Notice of Delisting or Failure to Satisfy a Continued Listing Rule or Standard; Transfer of Listing
  • 3.02: Unregistered Sales of Equity Securities
  • 3.03: Material Modifications to Rights of Security Holders
  • 4.01: Changes in Registrant's Certifying Accountant
  • 4.02: Non-Reliance on Previously Issued Financial Statements or a Related Audit Report or Completed Interim Review
  • 5.01: Changes in Control of Registrant
  • 5.02: Departure of Directors or Certain Officers; Election of Directors; Appointment of Certain Officers: Compensatory Arrangements of Certain Officers
  • 5.03: Amendments to Articles of Incorporation or Bylaws; Change in Fiscal Year
  • 5.04: Temporary Suspension of Trading Under Registrant's Employee Benefit Plans
  • 5.05: Amendments to the Registrant's Code of Ethics, or Waiver of a Provision of the Code of Ethics
  • 5.06: Change in Shell Company Status
  • 5.07: Submission of Matters to a Vote of Security Holders
  • 5.08: Shareholder Nominations Pursuant to Exchange Act Rule 14a-11
  • 6.01: ABS Informational and Computational Material
  • 6.02: Change of Servicer or Trustee
  • 6.03: Change in Credit Enhancement or Other External Support
  • 6.04: Failure to Make a Required Distribution
  • 6.05: Securities Act Updating Disclosure
  • 6.06: Static Pool
  • 6.10: Alternative Filings of Asset-Backed Issuers
  • 7.01: Regulation FD Disclosure
  • 8.01: Other Events
  • 9.01: Financial Statements and Exhibits
  • Signature

Usage

const { extractorApi } = secApi;

// Tesla 10-K filing
const filingUrl =
  'https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231.htm';

const sectionText = await extractorApi.getSection(filingUrl, '1A', 'text');
const sectionHtml = await extractorApi.getSection(filingUrl, '1A', 'html');

console.log(sectionText);
console.log(sectionHtml);

See the documentation for more details: https://sec-api.io/docs/sec-filings-item-extraction-api