Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save janlukasschroeder/8be8a0a299f6c5ba68939a92a82945aa to your computer and use it in GitHub Desktop.
Save janlukasschroeder/8be8a0a299f6c5ba68939a92a82945aa to your computer and use it in GitHub Desktop.
import requests
api_endpoint = "https://api.sec-api.io/extractor"
# 10-K filing URL
filing_url = "https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231.htm"
# list the items you want to extract.
# seperate multiple items with comma, e.g. "1A,2,5"
item = "1A"
# add your API key
api_key = "YOUR_API_KEY"
url = api_endpoint + "?url=" + filing_url + "&item=" + item + "&token=" + api_key
# perform an API request to get all items
response = requests.get(url)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment