Giter Club home page Giter Club logo

sec-api's Introduction

sec.gov EDGAR filings query, extraction, parser and real-time streaming API

  • Covers +18 million SEC Edgar filings for over 10,000 publicly listed companies, ETFs, hedge funds, mutual funds, and investors dating back to 1993.
  • Every filing is mapped to a CIK and ticker.
  • All +150 form types are supported, eg 10-Q, 10-K, 4, 8-K, 13-F, S-1, 424B4 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.
  • XBRL-to-JSON converter and parser API. Extract standardized financial statements from any 10-K and 10-Q filing.
  • No XBRL/XML needed - JSON formatted.
  • 13F holdings API included. Monitor all institutional ownerships in real-time.
  • 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

You can find more examples and details here: 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

Query API

The query API allows you to search and filter all 18 million filings published on SEC EDGAR.


The example below returns the most recent 10-Q filings.

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

queryApi.setApiKey('YOUR_API_KEY');

const query = {
  query: { query_string: { query: 'formType:"10-Q"' } }, // get most recent 10-Q filings
  from: '0', // start with first filing. used for pagination.
  size: '10', // limit response to 10 filings
  sort: [{ filedAt: { order: 'desc' } }], // sort result by filedAt
};

const filings = await queryApi.getFilings(rawQuery);

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

Full-Text Search API

Full-text search allows you to search the full text of all EDGAR filings submitted since 2001. The full text of a filing includes all data in the filing itself as well as all attachments (such as exhibits) to the filing.


The example below 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

Real-Time Streaming API

The stream API provides a live stream (aka feed) of newly published filings on SEC EDGAR. A new filing is sent to your connected client as soon as its published.


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 { streamApi } = require('sec-api');

streamApi.connect('YOUR_API_KEY');

streamApi.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.

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

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 see new filings printed in your command line as soon as they are published on SEC EDGAR.

React

Live Demo: https://codesandbox.io/s/01xqz2ml9l (requires an API key to work)

import { streamApi } from 'sec-api';

class Filings extends React.Component {
  componentDidMount() {
    const socket = streamApi('YOUR_API_KEY');
    socket.on('filing', (filing) => console.log(filing));
  }

  // ...
}

XBRL-To-JSON Converter API

Parse and standardize any XBRL and convert it to JSON. Extract financial statements and meta data from 10-K and 10-Q filings.

The entire US GAAP taxonomy is fully supported. All XBRL items are fully converted into JSON, including us-gaap, dei and custom items. XBRL facts are automatically mapped to their respective context including period instants and date ranges.

All financial statements are accessible and standardized:

  • StatementsOfIncome
  • StatementsOfIncomeParenthetical
  • StatementsOfComprehensiveIncome
  • StatementsOfComprehensiveIncomeParenthetical
  • BalanceSheets
  • BalanceSheetsParenthetical
  • StatementsOfCashFlows
  • StatementsOfCashFlowsParenthetical
  • StatementsOfShareholdersEquity
  • StatementsOfShareholdersEquityParenthetical

Variants such as ConsolidatedStatementsofOperations or ConsolidatedStatementsOfLossIncome are automatically standardized to their root name, e.g. StatementsOfIncome.

Income Statement - Example Item

{
  "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

There are 3 ways to convert XBRL to JSON:

const { xbrlApi } = secApi;

xbrlApi.setApiKey('YOUR_API_KEY');

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

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

// 10-K Accession Number Example
xbrlApi.xbrlToJson({ accessionNo: '0000320193-20-000096' }).then(console.log);

Example Response

Note: response is shortened.

{
 "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 Section Extractor API

The Extractor API returns individual sections from 10-Q and 10-K filings. The extracted section is cleaned and standardized - in raw text or in standardized HTML. You can programmatically extract one or multiple sections from any 10-Q and 10-K filing.

All 10-K and 10-Q sections can be extracted:

  • 1 - Business
  • 1A - Risk Factors
  • 1B - Unresolved Staff Comments
  • 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

Example

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

Filing Render & Download API

Download or render up to 40 filings per second. All filings, exhibits and attachements are supported. Access over 650,000 gigabyte of filings data. You can process the downloaded data in memory or save it to your hard drive.

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

renderApi.setApiKey('YOUR_API_KEY');

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

const filingContent = await renderApi.getFilingContent(filingUrl);

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

Response Format

  • accessionNo (string) - Accession number of filing, e.g. 0000028917-20-000033
  • cik (string) - CIK of the filing issuer. Important: trailing 0 are removed.
  • ticker (string) - Ticker of company, e.g. AMOT. A ticker is not available when non-publicly traded companies report filings (e.g. form 4 reported by directors). Please contact us if you find filings that you think should have tickers (but don't).
  • companyName (string) - Name of company, e.g. Allied Motion Technologies Inc
  • companyNameLong (string) - Long version of company name including the filer type (Issuer, Filer, Reporting), e.g. ALLIED MOTION TECHNOLOGIES INC (0000046129) (Issuer)
  • formType (string) - sec.gov form type, e.g 10-K. See the list of supported form types here.
  • description (string) - Description of the form, e.g. Statement of changes in beneficial ownership of securities
  • linkToFilingDetails (string) - Link to HTML, XML or PDF version of the filing.
  • linkToTxt (string) - Link to the plain text version of the filing. This file can be multiple MBs large.
  • linkToHtml (string) - Link to index page of the filing listing all exhibits and the original HTML file.
  • linkToXbrl (string, optional) - Link to XBRL version of the filing (if available).
  • filedAt (string) - The date (format: YYYY-MM-DD HH:mm:SS TZ) the filing was filed, eg 2019-12-06T14:41:26-05:00.
  • periodOfReport (string, if reported) - Period of report, e.g. 2021-06-08
  • effectivenessDate (string, if reported) - Effectiveness date, e.g. 2021-06-08
  • id (string) - Unique ID of the filing.
  • entities (array) - A list of all entities referred to in the filing. The first item in the array always represents the filing issuer. Each array element is an object with the following keys:
    • companyName (string) - Company name of the entity, e.g. DILLARD'S, INC. (Issuer)
    • cik (string) - CIK of the entity. Trailing 0 are not removed here, e.g. 0000028917
    • irsNo (string, optional) - IRS number of the entity, e.g. 710388071
    • stateOfIncorporation (string, optional) - State of incorporation of entity, e.g. AR
    • fiscalYearEnd (string, optional) - Fiscal year end of the entity, e.g. 0201
    • sic (string, optional) - SIC of the entity, e.g. 5311 Retail-Department Stores
    • type (string, optional) - Type of the filing being filed. Same as formType, e.g. 4
    • act (string, optional) - The SEC act pursuant to which the filing was filed, e.g. 34
    • fileNo (string, optional) - Filer number of the entity, e.g. 001-06140
    • filmNo (string, optional) - Film number of the entity, e.g. 20575664
  • documentFormatFiles (array) - An array listing all primary files of the filing. The first item of the array is always the filing itself. The last item of the array is always the TXT version of the filing. All other items can represent exhibits, press releases, PDF documents, presentations, graphics, XML files, and more. An array item is represented as follows:
    • sequence (string, optional) - The sequence number of the filing, e.g. 1
    • description (string, optional) - Description of the file, e.g. EXHIBIT 31.1
    • documentUrl (string) - URL to the file on SEC.gov
    • type (string, optional) - Type of the file, e.g. EX-32.1, GRAPHIC or 10-Q
    • size (string, optional) - Size of the file, e.g. 6627216
  • dataFiles (array) - List of data files (filing attachments, exhibits, XBRL files) attached to the filing.
    • sequence (string) - Sequence number of the file, e.g. 6
    • description (string) - Description of the file, e.g. XBRL INSTANCE DOCUMENT
    • documentUrl (string) - URL to the file on SEC.gov
    • type (string, optional) - Type of the file, e.g. EX-101.INS, EX-101.DEF or EX-101.PRE
    • size (string, optional) - Size of the file, e.g. 6627216
  • seriesAndClassesContractsInformation (array) - List of series and classes/contracts information
    • series (string) - Series ID, e.g. S000001297
    • name (string) - Name of entity, e.g. PRUDENTIAL ANNUITIES LIFE ASSUR CORP VAR ACCT B CL 1 SUB ACCTS
    • classesContracts (array) - List of classes/contracts. Each list item has the following keys:
      • classContract (string) - Class/Contract ID, e.g. C000011787
      • name (string) - Name of class/contract entity, e.g. Class L
      • ticker (string) - Ticker class/contract entity, e.g. URTLX

13F Institutional Ownerships

13F filings report institutional ownerships. Each 13F filing has an attribute holdings (array). An array item in holdings represents one holding and has the following attributes:

  • nameOfIssuer (string) - Name of issuer, e.g. MICRON TECHNOLOGY INC
  • titleOfClass (string) - Title of class, e.g. COM
  • cusip (string) - CUSIP of security, e.g. 98850P109
  • value (integer) - Absolute holding value in $, e.g. 18000. Note: value doesn't have to be multiplied by 1000 anymore. It's done by our API automatically.
  • shrsOrPrnAmt (object)
    • sshPrnamt (integer) - Shares or PRN AMT, e.g. 345
    • sshPrnamtType (string) - Share/PRN type, e.g. "SH"
  • putCall (string, optional) - Put / Call, e.g. Put
  • investmentDiscretion (string) - Investment discretion, e.g. "SOLE"
  • otherManager (string, optional) - Other manager, e.g. 7
  • votingAuthority (object)
    • Sole (integer) - Sole, e.g. 345
    • Shared (integer) - Shared, e.g. 345
    • None (integer) - None, e.g. 345

Example JSON Response

{
  "id": "79ad9e452ea42402df4fe55c636191d6",
  "accessionNo": "0001213900-21-032169",
  "cik": "1824149",
  "ticker": "JOFF",
  "companyName": "JOFF Fintech Acquisition Corp.",
  "companyNameLong": "JOFF Fintech Acquisition Corp. (Filer)",
  "formType": "10-Q",
  "description": "Form 10-Q - Quarterly report [Sections 13 or 15(d)]",
  "filedAt": "2021-06-11T17:25:44-04:00",
  "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169.txt",
  "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169-index.htm",
  "linkToXbrl": "",
  "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321_jofffintech.htm",
  "entities": [
    {
      "companyName": "JOFF Fintech Acquisition Corp. (Filer)",
      "cik": "1824149",
      "irsNo": "852863893",
      "stateOfIncorporation": "DE",
      "fiscalYearEnd": "1231",
      "type": "10-Q",
      "act": "34",
      "fileNo": "001-40005",
      "filmNo": "211012398",
      "sic": "6770 Blank Checks"
    }
  ],
  "documentFormatFiles": [
    {
      "sequence": "1",
      "description": "QUARTERLY REPORT",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321_jofffintech.htm",
      "type": "10-Q",
      "size": "274745"
    },
    {
      "sequence": "2",
      "description": "CERTIFICATION",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex31-1_jofffintech.htm",
      "type": "EX-31.1",
      "size": "12209"
    },
    {
      "sequence": "3",
      "description": "CERTIFICATION",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex31-2_jofffintech.htm",
      "type": "EX-31.2",
      "size": "12220"
    },
    {
      "sequence": "4",
      "description": "CERTIFICATION",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex32-1_jofffintech.htm",
      "type": "EX-32.1",
      "size": "4603"
    },
    {
      "sequence": "5",
      "description": "CERTIFICATION",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/f10q0321ex32-2_jofffintech.htm",
      "type": "EX-32.2",
      "size": "4607"
    },
    {
      "sequence": " ",
      "description": "Complete submission text file",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/0001213900-21-032169.txt",
      "type": " ",
      "size": "2344339"
    }
  ],
  "dataFiles": [
    {
      "sequence": "6",
      "description": "XBRL INSTANCE FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331.xml",
      "type": "EX-101.INS",
      "size": "248137"
    },
    {
      "sequence": "7",
      "description": "XBRL SCHEMA FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331.xsd",
      "type": "EX-101.SCH",
      "size": "43550"
    },
    {
      "sequence": "8",
      "description": "XBRL CALCULATION FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_cal.xml",
      "type": "EX-101.CAL",
      "size": "21259"
    },
    {
      "sequence": "9",
      "description": "XBRL DEFINITION FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_def.xml",
      "type": "EX-101.DEF",
      "size": "182722"
    },
    {
      "sequence": "10",
      "description": "XBRL LABEL FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_lab.xml",
      "type": "EX-101.LAB",
      "size": "309660"
    },
    {
      "sequence": "11",
      "description": "XBRL PRESENTATION FILE",
      "documentUrl": "https://www.sec.gov/Archives/edgar/data/1824149/000121390021032169/joff-20210331_pre.xml",
      "type": "EX-101.PRE",
      "size": "186873"
    }
  ],
  "seriesAndClassesContractsInformation": [],
  "periodOfReport": "2021-03-31",
  "effectivenessDate": "2021-03-31"
}

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

dependabot[bot] avatar janlukasschroeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sec-api's Issues

SIC Code

Jan,

I see you have some web based apps that allow you to look up companies and obtain their SIC code. http://mapping-api.herokuapp.com/sic/3711 And I see the streaming version allows you to pull the SIC code back but the query based one does not have it as a parameter. Any chance you are going to add it to your https://sec-api.io/ api.

Regards,

Scott Roth

Type of amendments

I encountered an issue while fetching 10-K/A form. It seems we don't have any response to check if the fetched amendment form is of 'Amendment No. 1' or 'Amendment No. 2'.

I used Full-Text Search API to check the types of amendment but it looks like some of the files contain both of the string 'Amendment No. 1' and 'Amendment No. 2', which makes it harder to differentiate the types.

Download more fillings in PDF

Hi, quick question.

Is it possible to download multiple files at once in pdf format? without entering any url. Example I would like to download 10-Q fillings of AAPL from 2020 to 2023, is it possible?

Problem to test api

I followed the steps to install sec-api in command-line

Command Line
In your command line, type

npm install sec-api -g to install the package

sec-api YOUR_API_KEY to connect to the stream. Replace YOUR_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.

When I launch the command sec-apy (MY API KEY), after a few minutes I receive this message "Socket connected to https://socket.sec-api.io/all-filings"

If I connect to that link, the following page opens. (1)
1

But if I connect to https://socket.sec-api.io/ the following page opens. (2)
2

I've been testing for a few days, and no "filling" has ever been shown per terminal (from the website either).
I have also followed the steps for node.js, and the result has also been the same as for "command-line".
After a few more minutes, if we update the page, the result is this. And the command keeps running.
3

In addition, we check on the sec.gov website for latest filings and actually there is some publications so the api should list them.

Is there something I am doing wrong or the api is currently broken ?

Simplify search query

What is the value of having 'query' inside 'query_string' inside 'query'?

"query": {
        "query_string": {
            "query": "cik:320193 AND filedAt:{2016-01-01 TO 2016-12-31} AND formType:\"10-Q\""
        }
    },

Wouldn't simply 'query' be enough? That will certainly simplify the use of the API.

Table name not standardized

In the documentation it is mentioned that all of the tables are standardized and Variants such as ConsolidatedStatementsofOperations or ConsolidatedStatementsOfLossIncome are automatically standardized to their root name, e.g. StatementsOfIncome.

But there are many Income Statement/Comprehensive Income Statement tables and Balance Sheets table which still needs to be standardized.

Available non-standardized tables:

- StatementOfIncomeInsuranceBasedRevenue
- StatementCOMBINEDANDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSSINCOME
- idr_StatementConsolidatedIncomeStatement
- StatementConsolidatedAndCombinedStatementsOfOperations
- StatementOfIncomeAlternative
- StatementsOfComprehensiveIncome
- idr_StatementConsolidatedStatementOfComprehensiveIncome
- StatementConsolidatedAndCombinedStatementsOfComprehensiveIncome
- ConsolidatedStatementsOfOperationsAndComprehensiveIncomeOrLoss
- BalanceSheet
- BalanceSheets

Also, do you keep the original table name after you have standardized the table names, can we also get those names, because while getting information on xbrl calculation linkbase we require the original table name ?

Run extractor API for multiple sik

I'd like to run extractor for multiple 10-k reports based on list of sik and years or list of downloaded reports in txt format. I see that it works only with url. Is it possible to change the input for this function?

Search API does not support application/json content type in request

Since the API expects a JSON object in a POST request, it's worth noting in the documentation that the request should not have its content type set to "application/json". It took me some time to figure out because the API simply responds with empty results.

Ideally, the API should support "application/json" content type as well. Or, at least, respond with an error when the wrong content-type is set on the request.

Mapping endpoint missing tickers

I query the mapping endpoint with the correct code, but the returned json doesn't contain any ticker symbol in its entry, just a blank string. Why?

[{'name': 'Ankam Inc.',
'ticker': '',
'cik': '1781629',
'cusip': '',
'exchange': '',
'category': '',
'sector': '',
'industry': '',
'sic': '7371',
'sicSector': '',
'sicIndustry': 'Services-Computer Programming Services',
'currency': '',
'location': '',
'id': '927c08da18b571354c033816edbe3394'}]

Flagging section request failure for SEC Extractor API

Hello,

I was recently working with your SEC API and wanted to flag an issue with the HTML section extraction module (ExtractorAPI).

In some cases for 10-Q fileType, section extraction fails to generate the expected full string response for the instructed subsection; the coded samples below might give you a better idea of the issue:

#Sample1

filing_link_url = 'https://www.sec.gov/Archives/edgar/data/1782524/000178252421000133/msdlfform10-qq32021.htm' 

subsection = 'part1item1' 

html = 'html'

extractorApi = ExtractorApi(api_key)

section_html = extractorApi.get_section(filing_link_url, subsection, html) 
#ISSUE: the returned section_html is incomplete

The above uses the 3Q21 filing from Morgan Stanley Direct Lending Fund


#Sample2
 
filing_link_url = 
'https://www.sec.gov/Archives/edgar/data/1782524/000178252421000107/msdlfform10-qq22021.htm'

subsection = 'part1item1' 

html = 'html'

extractorApi = ExtractorApi(api_key)

section_html = extractorApi.get_section(filing_link_url, subsection, html) 
#ISSUE: the returned section_html string is incomplete

The above uses the 2Q21 filing from Morgan Stanley Direct Lending Fund; I am experiencing the same issue for the 1Q21 filing as well (https://www.sec.gov/Archives/edgar/data/1782524/000178252421000107/msdlfform10-qq22021.htm)

For quarterlies and the 10-K for reporting periods prior to 2021, the extractorAPI returns the expected response. For the 2021 10-K onwards, the extractorAPI also returns the expected response (issue seems to be isolated to these 2021 quarterly filings for subsection part1item1).

Thanks!

Replicating the income statement as it appears on the SEC form without extra revenue segments being pulled in

I am trying to replicate the income statement as shown in the company's 10-K (or 10-Q) so I can perform segment analysis.
For example, for Tesla (found here) we want

tsla-income-statement

where we can see revenue is broken out by segment. However, it is difficult (if not impossible to) recreate this table without extra data being pull in. My code as follows will demonstrate this.

import pandas as pd

url_10k_tsla = 'https://www.sec.gov/Archives/edgar/data/1318605/000162828024002390/tsla-20231231.htm'
xbrl_tsla_json = xbrlApi.xbrl_to_json(htm_url=url_10k_tsla)


# Initialize an empty DataFrame
df = pd.DataFrame(columns=['period'])

# Iterate through each key in the JSON data
for key, values in xbrl_tsla_json['StatementsOfIncome'].items():

    # See if there are segments first
    has_segments = False
    for value in values:
        if 'segment' in value:
            has_segments = True

    
    for value in values:
        # Extract period and value
        period = value['period']['startDate'] + ' - ' + value['period']['endDate']

        # if there are segments 
        if has_segments:
            # Get the value out of the segment or call it total.
            segment_name = value.get('segment', {}).get('value', 'Total').split(':')[-1]
            value_key = key + ' - ' + segment_name
        # There are no segments
        else:
            segment_name = value.get('value')
            value_key = key
        
        # Check if period already exists in DataFrame
        if period in df['period'].values:
            # Update existing row
            df.loc[df['period'] == period, value_key] = value['value']
        else:
            # Add new row
            row = {'period': period}
            row[value_key] = value['value']
            df = pd.concat([df, pd.DataFrame([row])], ignore_index=True)

df.set_index('period', inplace=True)

# convert all DataFrame columns to the int64 dtype
df = df[df.columns[~df.columns.isin(['EarningsPerShareBasic', 'EarningsPerShareDiluted'])]].astype(np.float64)

# Round all columns to millions except the EarningsPerShareBasic and EarningsPerShareDiluted	
df = df[df.columns[~df.columns.isin(['EarningsPerShareBasic', 'EarningsPerShareDiluted'])]].divide(1_000_000)

df.T

will produce the following pandas table:

image

In particular, the table lists two extra revenue sources, RevenueFromContractWithCustomerExcludingAssessedTax - EnergyGenerationAndStorageSalesMember and RevenueFromContractWithCustomerExcludingAssessedTax - SalesAndServicesMember as well as two extra gross profits (although I am not as concerned with these). These two extra revenue sources come from the 'Revenue Recognition - Revenue by source' table which is separate from the income statement. Is there a way to keep these extra revenue sources from being pulled in (without hard coding their names since I want to apply this technique to many companies) so that my code replicates exactly the income statement as it appears in the filing?

additional features

Hi,

Thanks a lot for this tool, it is great.
Do you plan on adding a way to "search" for latest filings for example by CIK number? It will avoid missing some filings if the user server goes down (or the heroku instance).

Websocket Delays

id 7060c2f223db6f67ad1e546e1187a405

This appeared on the secapi ws at "time": "2023-03-23T10:14:26.268414"
However, this filing was publicly available much earlier. I'm showing benzinga had it at 06:05:37 EST and bloomberg had it at 06:05:19 so looks like there was a lag of about 9 minutes from when secapi received and processed it

No data coming down the stream

I followed the instructions for receiving streaming data and created:

const { streamApi } = require('sec-api');
streamApi.connect('YOUR_API_KEY');
streamApi.on('filing', (filing) => console.log(filing));

It connects using my API_KEY and returns "Socket connected to https://api.sec-api.io:3334/all-filings" nothing else is printed on stdout even though I see new filings appearing at the SEC website. Does anyone have this working?

Thank you!

Form PF

Hi, I'm particularly interested in collecting data on Form PF. I see that it's included among the list of forms for your library. But I was wondering if you could point out the original repository on SEC that you use to draw out the Form PF? thanks.

Server down?

Is the Heroku server down? The socket stopped delivering the documents.

Is the source for the server available? I'd like to run one in-house.

No XBRL Data Available

CIK: 0000355379

Using sec-api we get a message 'No XBRL data available for this filing. XBRL was made mandatory in 2009. You can find more details here: https://www.sec.gov/page/osdhistoryandrulemaking'

But from companyfacts we can actually get the data of this CIK.
Link to companyfacts: https://data.sec.gov/api/xbrl/companyfacts/CIK0000355379.json

So, why is sec-api not able to extract data of this CIK, is it not XBRL ?

Too many securities missing the filing results

Hi,

Our project has used sec-api, but we found that some securities missing the filing results.

For example Alibaba ticker:BABA:

截屏2020-05-21 18 12 30

截屏2020-05-21 18 15 49

https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0001577552&owner=include&count=40

curl -XPOST -H "Content-type: application/json" -d '{
    "query": {
        "query_string": {
            "query": "ticker:BABA"
        }
    },
    "from": "0",
    "size": "50",
    "sort": [
        {
            "filedAt": {
                "order": "desc"
            }
        }
    ]
}' https://api.sec-api.io
{
  "total": {
    "value": 220,
    "relation": "eq"
  },
  "filings": [
    {
      "id": "0f643e74e69d1ea175fe53763a68310f",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "13F-HR",
      "description": "Quarterly report filed by institutional managers, Holdings",
      "filedAt": "2020-05-15T16:30:34-04:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920062658/0001104659-20-062658.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920062658/0001104659-20-062658-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920062658/xslForm13F_X01/primary_doc.xml"
    },
    {
      "id": "3ac7d6c591541c557a7b1e1e47b099c4",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2020-05-11T06:35:42-04:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920059072/0001104659-20-059072.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920059072/0001104659-20-059072-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920059072/a20-19234_16k.htm"
    },
    {
      "id": "5ae3e094c59b66e94a621ddee4af7e85",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Subject)",
      "formType": "SC 13G/A",
      "description": "[Amend] Statement of acquisition of beneficial ownership by individuals",
      "filedAt": "2020-02-21T06:09:12-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000119312520043995/0001193125-20-043995.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000119312520043995/0001193125-20-043995-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1065521/000119312520043995/d886028dsc13ga.htm"
    },
    {
      "id": "846f29f2144f6ca29dcabcb3b35969d8",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2020-02-13T16:30:24-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920020231/0001104659-20-020231.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920020231/0001104659-20-020231-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920020231/a20-7896_16k.htm"
    },
    {
      "id": "607c9ebed5cc12970b401716784538f2",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2020-01-23T06:40:05-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920006055/0001104659-20-006055.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920006055/0001104659-20-006055-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465920006055/a20-5658_16k.htm"
    },
    {
      "id": "6788886d4ddf273185f75da9ae3dc5b7",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-12-03T08:00:22-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919069221/0001104659-19-069221.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919069221/0001104659-19-069221-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919069221/a19-24249_16k.htm"
    },
    {
      "id": "cbe18776e11062824ad2ab166ca4fe90",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-11-29T06:06:24-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919068453/0001104659-19-068453.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919068453/0001104659-19-068453-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919068453/a19-22052_66k.htm"
    },
    {
      "id": "4baae52ae044923e922e0de2e2a614ac",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "424B5",
      "description": "Prospectus [Rule 424(b)(5)]",
      "filedAt": "2019-11-20T16:48:45-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006436/0001047469-19-006436.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006436/0001047469-19-006436-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006436/a2240126z424b5.htm"
    },
    {
      "id": "96643b4e6c71392dd042f9d9928c092a",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Subject)",
      "formType": "FWP",
      "description": "Filing under Securities Act Rules 163/433 of free writing prospectuses",
      "filedAt": "2019-11-14T17:08:52-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006311/0001047469-19-006311.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006311/0001047469-19-006311-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006311/a2240099zfwp.htm"
    },
    {
      "id": "05af9ee9d759d259bdc57c8de26a8473",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "424B5",
      "description": "Prospectus [Rule 424(b)(5)]",
      "filedAt": "2019-11-13T08:08:11-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006274/0001047469-19-006274.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006274/0001047469-19-006274-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006274/a2240065z424b5.htm"
    },
    {
      "id": "779e304ac18e9f3503b4b435f561dc8a",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-11-13T07:28:51-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006269/0001047469-19-006269.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006269/0001047469-19-006269-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006269/a2240063z6-k.htm"
    },
    {
      "id": "3fc1ab836eb7e5931db81e44aafa4955",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "F-3ASR",
      "description": "Automatic shelf registration statement of securities of well-known seasoned issuers",
      "filedAt": "2019-11-13T07:05:12-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006267/0001047469-19-006267.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006267/0001047469-19-006267-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006267/a2240026zf-3asr.htm"
    },
    {
      "id": "5b77bfe49385c05ee91386deb99d2259",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-11-13T06:22:41-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006258/0001047469-19-006258.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006258/0001047469-19-006258-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006258/a2240023z6-k.htm"
    },
    {
      "id": "ede4c25d6740d90f40955b36105a9445",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-11-13T06:18:32-05:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006257/0001047469-19-006257.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006257/0001047469-19-006257-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000104746919006257/a2239435z6-k.htm"
    },
    {
      "id": "553cc494cc19b3656753fa785fbe4563",
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "companyNameLong": "Alibaba Group Holding Ltd (0001577552) (Filer)",
      "formType": "6-K",
      "description": "Report of foreign issuer [Rules 13a-16 and 15d-16]",
      "filedAt": "2019-11-01T16:31:20-04:00",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919059003/0001104659-19-059003.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919059003/0001104659-19-059003-index.htm",
      "linkToXbrl": "",
      "linkToFilingDetails": "https://www.sec.gov/Archives/edgar/data/1577552/000110465919059003/a19-21664_16k.htm"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-09-24",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-051206.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-051206-index.htm",
      "id": "b6b9133f5ccca85cd0374f78ab5fe3b8"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "SC 13D/A",
      "filedAt": "2019-09-19",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-050668.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-050668-index.htm",
      "id": "416cef2973eb6ec28b79e748a420a3b0"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "S-8",
      "filedAt": "2019-09-16",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-050278.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-050278-index.htm",
      "id": "2b07845054d9b6cf82e72e6c166f1be4"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-09-11",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-049759.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-049759-index.htm",
      "id": "cc2854ec288f924f87b4c3b24cabe4b6"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-09-06",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-048991.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-048991-index.htm",
      "id": "f4a66be62bb4f5b08d14b530cb66d2ac"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-08-15",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-046150.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-046150-index.htm",
      "id": "0cdb7c07cf4aa16d6fa14610688228ee"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "13F-HR",
      "filedAt": "2019-08-14",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-045929.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-045929-index.htm",
      "id": "ef35b028e3e05090d5bf35792ace424e"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "CT ORDER",
      "filedAt": "2019-08-05",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/9999999997-19-006363.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/9999999997-19-006363-index.htm",
      "id": "6f40464dd3eb0495c5eeb7d12207e86d"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-07-30",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-042446.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-042446-index.htm",
      "id": "499115a702f44439814076e9cc631e8a"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "424B3",
      "filedAt": "2019-07-30",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001193805-19-000685.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001193805-19-000685-index.htm",
      "id": "6f5a730b5ac09e0d50ee64075d33580c"
    },
    {
      "cik": "1577552",
      "ticker": "BABA",
      "companyName": "Alibaba Group Holding Ltd",
      "formType": "6-K",
      "filedAt": "2019-07-15",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-040358.txt",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-040358-index.htm",
      "id": "d58970f6c9ced6c46bf4438dc7bad398"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2019-06-17",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-035956.txt",
      "id": "af347e792f30990286f69373c3fb96f3",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-035956-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "20-F",
      "filedAt": "2019-06-05",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001047469-19-003492.txt",
      "id": "2e073aaff0c6302f17d37e7693a52ad2",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001047469-19-003492-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "IRANNOTICE",
      "filedAt": "2019-06-05",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-034044.txt",
      "id": "2dcff500b616969f90e45278cb048706",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-034044-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "SD",
      "filedAt": "2019-05-31",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-032952.txt",
      "id": "2ebd5abf84255714af2ac012d730614d",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-032952-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "F-6EF",
      "filedAt": "2019-05-17",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001193805-19-000501.txt",
      "id": "fb3962ed39710b385df9b89aa3e7bc74",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001193805-19-000501-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2019-05-15",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-029738.txt",
      "id": "d2b01ab6c531123fdd1d5c5943eb0b65",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-029738-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "13F-HR",
      "filedAt": "2019-05-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-029334.txt",
      "id": "7f484bdd8834033c4e13a19f816fc968",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-029334-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2019-04-29",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-024217.txt",
      "id": "061bd103cb97dbf37feaa2a9e6b21527",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-024217-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2019-03-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-014857.txt",
      "id": "2a18b2d6fd2faeca0c73f3d82f0fc497",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-014857-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "SC 13G",
      "filedAt": "2019-02-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008111.txt",
      "id": "479363f193b7c3407dd94ff468c037d3",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008111-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "SC 13G/A",
      "filedAt": "2019-02-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008728.txt",
      "id": "f77f86268028870c7fb4d0f723542c62",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008728-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "SC 13G/A",
      "filedAt": "2019-02-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001193125-19-039407.txt",
      "id": "fea54f016d4861c3eb80239ad219208d",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001193125-19-039407-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "13F-HR",
      "filedAt": "2019-02-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008706.txt",
      "id": "7463e7a2c1f9ed31cf25f054ca400b4a",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-008706-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "SC 13G/A",
      "filedAt": "2019-02-08",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001193125-19-031445.txt",
      "id": "c1c234aa9cbed6209f8335c2e6e5a83c",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001193125-19-031445-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2019-01-30",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-004478.txt",
      "id": "f479cf7419ad0a3f6ab1dc58a9e85d29",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-19-004478-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-12-31",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-075203.txt",
      "id": "a0b8bc5fe8f8d7b02daef30ca4953abc",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-075203-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-12-04",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-071210.txt",
      "id": "663ccaeefe70dc3e6f3e01b4199bbf64",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-071210-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "13F-HR",
      "filedAt": "2018-11-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-068464.txt",
      "id": "f4e15db0769586a6d19d6c823fda201e",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-068464-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-11-02",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-065748.txt",
      "id": "ae6c31efa1e866a62cc17277aef9f9f7",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-065748-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-10-31",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-065094.txt",
      "id": "15ab87c8571809ab884241181c7c803b",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-065094-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-09-10",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-055896.txt",
      "id": "606218077a7ffffed3d114055211c4a2",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-055896-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-09-07",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-055708.txt",
      "id": "755ce5b8dfa4b2c7679ea16916f57aa1",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-055708-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "6-K",
      "filedAt": "2018-08-23",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-053369.txt",
      "id": "4c575a563c8b42b426e3745a2365a38b",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-053369-index.htm"
    },
    {
      "ticker": "BABA",
      "formType": "13F-HR",
      "filedAt": "2018-08-14",
      "cik": "1577552",
      "companyName": "Alibaba Group Holding Ltd",
      "linkToTxt": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-051964.txt",
      "id": "186a58e669c2053d78ba66743d2a069c",
      "linkToHtml": "https://www.sec.gov/Archives/edgar/data/1577552/0001104659-18-051964-index.htm"
    }
  ]
}

XBRL Conversion Started

While using the xbrl_to_json api I am getting an error {'message': 'XBRL conversion started, but the processing has not been completed. Please try again after 60 seconds.'}. Some days before I was able to fetch the records for the same xbrl but now it is showing the error. Also, it is showing such issue for most of the companies.

xbrl url: https://www.sec.gov/ix?doc=/Archives/edgar/data/0001039828/000103982821000018/ael-20201231.htm

Note: Even though the messages says to try again after 60 seconds, it does not work. It's been more than a week, I am getting this error.

Regards.

Wrong search results

The following request:

curl -d '{"query":{"query_string":{"query":"cik:0000320193 AND formType:\"10-Q\""}},"from":"0","size":"10","sort":[{"filedAt":{"order":"desc"}}]}' -X POST https://api.sec-api.io

returns results completely unrelated to the query.

sec-api for PHP

Hi, I love to use this module. It worked in the Python and Node.js, react.js and so on.
But I want to use the stream api of sec-api in PHP.
Can you please let me know how to use stream api in the PHP in detail?
Looking forward to hearing from you.
Thanks

Invalid data in financial statements

SEC-API provides financial statements in separate tables such as BalanceSheet, StatementsOfIncome and many others.

But looking at some of the companies/cik the xbrl_to_json api is providing data from some other tables which does not belong to the Balancesheet or the StatementsOfIncome

One such company is 0000764897

If we select only the RevenueFromContractWithCustomerExcludingAssessedTax of the company in StatementsOfIncome,
it gives some extra data which is not present in StatementsOfIncome, rather in some other tables.

from sec_api import XbrlApi

xbrlApi = XbrlApi(api_key)

url = "https://www.sec.gov/Archives/edgar/data/0000764897/000156459021018959/brst-10k_20201231.htm"

json_statements = xbrlApi.xbrl_to_json(htm_url=url)

revenues = [rev for rev in json_statements['StatementsOfIncome']['RevenueFromContractWithCustomerExcludingAssessedTax'] 
 if rev['period']['endDate'] == '2020-12-31']

print(revenues)

Output:

[{'decimals': '-3',
  'unitRef': 'U_iso4217USD',
  'period': {'startDate': '2020-01-01', 'endDate': '2020-12-31'},
  'segment': {'dimension': 'srt:ProductOrServiceAxis',
   'value': 'brst:CommissionsMember'},
  'value': '2437000'},
 {'decimals': '-3',
  'unitRef': 'U_iso4217USD',
  'period': {'startDate': '2020-01-01', 'endDate': '2020-12-31'},
  'segment': {'dimension': 'srt:ProductOrServiceAxis',
   'value': 'brst:ManagementAndOtherFeesMember'},
  'value': '1358000'},
 {'decimals': '-3',
  'unitRef': 'U_iso4217USD',
  'period': {'startDate': '2020-01-01', 'endDate': '2020-12-31'},
  'segment': [{'dimension': 'srt:ProductOrServiceAxis',
    'value': 'brst:LeasingCommissionsMember'},
   {'dimension': 'us-gaap:AdjustmentsForNewAccountingPronouncementsAxis',
    'value': 'us-gaap:AccountingStandardsUpdate201409Member'},
   {'dimension': 'us-gaap:TimingOfTransferOfGoodOrServiceAxis',
    'value': 'us-gaap:TransferredAtPointInTimeMember'}],
  'value': '2313000'},
 {'decimals': '-3',
  'unitRef': 'U_iso4217USD',
  'period': {'startDate': '2020-01-01', 'endDate': '2020-12-31'},
  'segment': [{'dimension': 'srt:ProductOrServiceAxis',
    'value': 'us-gaap:AssetManagement1Member'},
   {'dimension': 'us-gaap:AdjustmentsForNewAccountingPronouncementsAxis',
    'value': 'us-gaap:AccountingStandardsUpdate201409Member'},
   {'dimension': 'us-gaap:TimingOfTransferOfGoodOrServiceAxis',
    'value': 'us-gaap:TransferredOverTimeMember'}],
  'value': '711000'},
.....
.....
.....
]

Extra data are fetched from the following tables,

Screen Shot 2022-04-06 at 15 57 50

Screen Shot 2022-04-06 at 15 58 04

ExtractorApi returns "undefined" for Item 9B

I ran the test app below for a URL and it returned "Undefined" for Item 9B. Item 9B had an entry on the 10-K
https://sec-api.io/docs/sec-filings-item-extraction-api-python-example

filing_url = "https://www.sec.gov/ix?doc=/Archives/edgar/data/0000004281/000000428120000038/form10k4q19.htm"

To ensure it is not licensing issue (c.f with #25), we experimented with an expired license and a good one. For the expired license it threw
166 # request failed --> 167 raise Exception("API error")

But for the valid license it threw "undefined" which is incorrect.

TLDR, the API throws an undefined error for Item 9B.

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.