Maneet Singh
Maneet Singh

Reputation: 21

Can ExtractorApi in sec-api module be used for 10-Q filings?

I am trying to extract specific sections from the 10-Q report using ExtractorApi from sec-api module. The module works for 10-K, however, it fails with certain sections for the 10-Q. For example, if I want to extract item 3 from 10-Q, the following code works perfectly:

from sec_api import ExtractorApi 
extractorApi = ExtractorApi("YOUR API KEY") #Replace this with own API key

# 10-Q filing
filing_url = "https://www.sec.gov/Archives/edgar/data/789019/000156459021002316/msft-10q_20201231.htm"

# get the standardized and cleaned text of section
section_text = extractorApi.get_section(filing_url, "3", "text")
print(section_text)

But when I try to extract Item 1A. Risk Factors, the code below returns 'undefined':

from sec_api import ExtractorApi 
extractorApi = ExtractorApi("YOUR API KEY") #Replace this with own API key

# 10-Q filing
filing_url = "https://www.sec.gov/Archives/edgar/data/789019/000156459021002316/msft-10q_20201231.htm"

# get the standardized and cleaned text of section
section_text = extractorApi.get_section(filing_url, "21A", "text") #Using 21A from the documentation of sec-api 
print(section_text)

Is there a workaround to extract these sections from 10-Q filings?

Upvotes: 1

Views: 716

Answers (2)

Elijas Dapšauskas
Elijas Dapšauskas

Reputation: 1262

Note, that you can also use the sec-api.io REST API directly. This allows to minimize the use of external dependencies, and streamline external integrations with REST frameworks.

Here's an example:

import requests 
filing_url = "https://www.sec.gov/Archives/edgar/data/789019/000156459021002316/msft-10q_20201231.htm"

extractor_api_url = "https://api.sec-api.io/extractor"
params = {
    "url": filing_url,
    "item": section,
    "type": "part2item1a",
    "token": "YOUR API KEY",
}
response = requests.get(extractor_api_url, params=params)
part2item1a = response.text

Upvotes: 1

Jay
Jay

Reputation: 2069

Yes, the Extractor API supports the extraction of sections of 10-Q filings as well.

If you want to extract item section 1A (risk factors), try using part2item1a as item parameter instead of 21A.

The correct code looks like this:

from sec_api import ExtractorApi 
extractorApi = ExtractorApi("YOUR API KEY") # Replace this with own API key

# 10-Q filing
filing_url = "https://www.sec.gov/Archives/edgar/data/789019/000156459021002316/msft-10q_20201231.htm"

# get the standardized and cleaned text of section
section_text = extractorApi.get_section(filing_url, "part2item1a", "text") # Using part2item1a from the documentation of sec-api 
print(section_text)

Upvotes: 0

Related Questions