Skip to main content
A company data API can help developers enrich business records with information from external sources. SEC EDGAR filings provide public company disclosures, while Wikipedia provides background information and descriptions. In this tutorial, you’ll use Python and Dataville’s API to enrich company records during onboarding. You’ll retrieve SEC filing metadata and Wikipedia articles, then attach the results to a signup record without requiring users to enter the information manually.

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.

Enrich company records with Python

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 enriched a company record, you can extend the workflow by monitoring its SEC filings for new disclosures or exploring how Dataville handles API responses and stale data.

Automate SEC Filing Alerts with Python

Monitor new SEC filings for companies on your watchlist and send automated alerts to Slack, Microsoft Teams, or email.

Response format

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

Verify Business Applications with Claude and SEC Filings

Compare business application details against SEC filings using Claude.