1

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • I've been working on the same topic since yesterday. For documentation, do you mean this one https://pypi.org/project/sec-api/? If so, there's no '21A' and I saw you want '1A', so is it a typo in your code? – uniquegino Feb 24 '22 at 20:47

2 Answers2

0

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)
Jay
  • 1,564
  • 16
  • 24
0

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
Elijas Dapšauskas
  • 909
  • 10
  • 25