Skip to main content
When a business signs up, you can look up its most recent SEC filing and its Wikipedia article and store both with the application. A reviewer can then open the filing and the article from the record instead of searching for them. In this guide, you’ll add a Python function to your signup flow that runs both lookups through Dataville and returns the fields to store.

Before you start

You’ll need:
  • A Dataville account and its API key, from the API Keys page.
  • Python 3.
  • A signup form that asks for the business’s full legal name.

Add the lookups to your signup flow

You can try the function from a terminal before you add it to your signup code.
1

Download the enrichment script

The script has an enrich function that looks up a business in SEC EDGAR and Wikipedia, checks that each result is about that business, and returns the fields to store. Download it into the folder that holds your signup code.

enrich.py

Download the enrichment script.
2

Try it on a public company

Set your API key, then run the script with a business’s legal name:
The script prints the record that enrich returns. Here is the record for The Home Depot on September 25, 2026, with the abstract shortened:
filing holds the business’s most recent 10-K, 10-Q, or 8-K, and document_url links to it on sec.gov. background holds the Wikipedia article’s title, link, and opening paragraph.
3

Try it on a private company

Most businesses that sign up aren’t SEC filers. Run the script with the example private company:
Northwind Payments LLC is a made-up company, so there’s nothing to store:
The edgar source returned another company’s filing that mentions the name, a 2020 filing by a mortgage trust, and enrich skips a result like that. Wikipedia has no article about the business, so background is empty too.Use the business’s full legal name. A short name can match an article about something else: Oracle returns Wikipedia’s article about oracles in divination, and the title check can’t tell it apart from the company. Oracle Corporation returns the company’s article.
4

Call it from your signup flow

Import enrich in your signup code and store what it returns with the application. A failed lookup shouldn’t stop a signup, so catch DatavilleError and look the business up again later:
enrich raises DatavilleError for anything other than a result or no result, such as 401 for a wrong API key or 429 when you reach a limit. To learn more about each error, see Troubleshooting.If a source is unavailable, Dataville answers from its stored copy and enrich sets stale to true. Run enrich again for those records later, and replace the stored fields once stale is false. See Response format to learn more about stale results.

Next steps

Once you’ve approved a business, you can watch it for new filings.

Monitor SEC filings for a watchlist

Check the companies you’ve approved for new filings every weekday morning.

Response format

Every field in the envelope, and how Dataville reports errors and stale results.