Skip to main content
After you approve a loan or a policy, a company’s SEC filings will tell you when something changes. A new 10-Q or 10-K reports its latest results, and an 8-K reports an event such as new debt or a change of control. In this guide, you’ll set up a Python script that checks a list of companies each weekday morning and sends any new filings to Slack, Microsoft Teams, or email.

Before you start

You’ll need:
  • A Dataville account and its API key, from the API Keys page.
  • Python 3.
  • jq, if you’ll send alerts to Slack or Microsoft Teams.

Set up the watchlist

Put every file from these steps in one folder, on the machine that will run the script.
1

Download the watchlist template

The template has a company column with one company per row, and four examples.

watchlist.csv

Download the template with the example companies.
The file looks like this:
Northwind Payments LLC is a made-up private company, so you can see what the script does with a business that doesn’t file with the SEC. To watch your own companies, replace the examples with each company’s legal name and save the file as watchlist.csv.
2

Download the watchlist script

The script looks up each company in the edgar source, compares the result with the filing it saw on the last run, and prints a line for each new filing. Download it into the same folder as watchlist.csv.

watchlist.py

Download the watchlist script.
3

Run the script once

The first run records the most recent filing for each company. Set your API key, then run the script in the same terminal:
If you installed Python from python.org on a Mac and the script stops with CERTIFICATE_VERIFY_FAILED, run Install Certificates.command from your Python folder in Applications, then run the script again.For the example companies, the first run on September 24, 2026 printed:
Dataville returns each company’s most recent 10-K, 10-Q, or 8-K, and the script saves it to filings.json. Every filing has an accession number that identifies it. On later runs, the script prints a line only when a company’s accession number has changed, which means the company has filed something new. If the last run had recorded IQVIA’s 8-K from September 9, 2026, the next run would print:
An 8-K’s items say what it reports. Item 1.01 is a new material agreement, and item 2.03 is a new financial obligation, such as a loan.Dataville limits requests to 100 per 15 minutes per IP address, so a watchlist of more than 100 companies needs a pause between batches. When you reach a limit, the script stops with a line such as Dataville returned 429 Too Many Requests for The Home Depot. See Usage limits for the other limits.If SEC EDGAR is unavailable, Dataville answers from its stored copy and adds a stale object to the result. The script skips those companies and checks them again on the next run, so it never reports an old copy as a new filing. See Response format to learn more about stale results.
4

Send new filings to your team

The script prints nothing when there are no new filings, so a short wrapper script can send its output to your team only when there’s something to report. The wrapper reads where to send alerts from an environment variable, so you won’t need to edit it.
Create an incoming webhook in your Slack workspace by following Slack’s guide to sending messages using incoming webhooks. In the terminal where you set your API key, set WEBHOOK_URL to the webhook’s URL:

watchlist.sh

Download the Slack wrapper.
Download the wrapper into the same folder as watchlist.py, and make it executable:
To test it, delete filings.json so the script starts over, then run the wrapper in the same terminal:
The first-run lines from the previous step will arrive in your channel or inbox.
5

Run the watchlist every weekday morning

Companies file throughout the business day, so a run each weekday morning will report the previous day’s filings. Cron doesn’t use the variables you set in your terminal, so set them at the top of your crontab, above the entry. This crontab runs the wrapper at 7 AM on weekdays, in the machine’s time zone:
Replace /path/to/watchlist with the folder that holds your files. For the email wrapper, set ALERT_EMAIL in place of WEBHOOK_URL. If you haven’t scheduled a script before, ask ChatGPT how to on macOS, Linux, or Windows. Windows has no cron, so on Windows you’ll use Task Scheduler instead.

Next steps

To check a business before you approve it, or to look up what an error in the script means, see these pages.

Check applications in Claude

Check a batch of applications against SEC filings before you decide.

Troubleshooting

What each error code means, and when to retry.