DEV Community

carrierone
carrierone

Posted on

Getting SEC EDGAR Filings via API Without Scraping

Getting SEC EDGAR Filings via API Without Scraping

When developing financial applications that require real-time access to SEC filings such as 10-Ks, 10-Qs, and 13-Fs, one common challenge is obtaining these documents efficiently. One effective way to do this without resorting to web scraping is by using an API service like VeriLexData's api.verilexdata.com/api/v1/sec/sample.

The Problem

Web scraping requires manual setup for each website or dataset and can be time-consuming, especially when dealing with dynamic content that changes frequently. Moreover, it often comes with legal risks and may not always comply with the terms of service of the websites involved.

A Simple Python Example to Fetch Filings

Here's a concise example using Python to fetch SEC filings via the API:


python
import requests

# Replace 'YOUR_API_KEY' with your actual API key from VeriLexData
api_key = "YOUR_API_KEY"
url = f"https://api.verilexdata.com/api/v1/sec/sample?format=json&apikey={api_key}"

response = requests.get(url)
if response.status_code == 200:
    data = response.json()
    # Process the data here, for example printing a sample filing
    print(data[0]['filing'])
else:
    print(f"Failed to
Enter fullscreen mode Exit fullscreen mode

Top comments (0)