DEV Community

How to look up companies in Secretary of State registries with Python (and get a daily list of new LLCs)

Disclosure: I built the Apify actor used in the second half of this post. It is a paid tool (pay per entity). The first half is free and uses only state open data.

Every LLC and corporation in the US is registered with a state. The state keeps a public record: legal name, entity ID, type, status, formation date, addresses and a registered agent.

That record answers a lot of practical questions:

  • Does this vendor or customer actually exist? Know-your-business (KYB) checks start here.
  • What is its exact legal name, and is it still active? Useful before you sign a contract or send an invoice.
  • Which businesses were formed this week in my city? New companies need banks, accountants, insurance, websites and office space.

The trouble is that every state runs its own registry. Each has its own search page, its own field names and its own ID format. The search pages are built for one person checking one name, not for a list of 500 names.

The good news: several states publish their registry as official open data. This post shows how to query that data yourself, then how to search six states at once with one call.

What is in a registry record

The fields differ by state, but most records have the same core:

  • Entity ID - The state's own number for the company. Use it, not the name, as your key.
  • Legal name - The registered name, which can differ from the brand name.
  • Type - LLC, corporation, nonprofit, partnership and so on.
  • Domestic or foreign - Formed in this state, or formed elsewhere and registered to do business here.
  • Status - For example Good Standing, Delinquent or Forfeited.
  • Formation date - When the entity was formed or registered.
  • Registered agent - The person or company that accepts legal papers for the entity.
  • Addresses - Principal office and mailing address.

Two things trip people up. First, one company can have records in several states: a domestic record where it was formed, and foreign records elsewhere. Second, some states publish only active entities, while others include dissolved ones too.

The free way: query one state's open data

Colorado publishes its whole business registry on data.colorado.gov. Like many state portals, it runs on Socrata, which has a simple query API. You filter with a SQL-like $where parameter:

import requests
URL = "https://data.colorado.gov/resource/4ykn-tg5h.json"
params = {
    "$where": "upper(entityname) like '%BLUE%' AND upper(entityname) like '%BOTTLE%'",
    "$limit": 20,
}
for r in requests.get(URL, params=params, timeout=30).json():
    print(r.get("entityid"), r.get("entityname"), r.get("entitystatus"), r.get("entityformdate"))

New filings work the same way. Filter on the formation date and sort newest first:

params = {
    "$where": "entityformdate >= '2026-11-12T00:00:00'",
    "$order": "entityformdate DESC",
    "$limit": 100,
}

That is one state. If you need more, you will find that:

  • Every state uses different column names. Colorado has entityformdate. Other states call the formation date something else, and the same goes for names, IDs and addresses.
  • Type and status codes differ. Colorado uses codes like DLLC. You need a lookup table per state to turn them into "LLC" and "active".
  • Some records span several rows. Officers and representatives can come as extra rows per entity, which you must group.
  • Coverage and freshness differ. Some states update daily, some lag by days or a week.
  • You need state for a daily feed. To send only new entities, you must remember which ones you already sent.

None of this is hard. It adds up to a small project per state.

The hosted way: six states, one schema

Business Entity Search is the Apify actor I built that does the above for six states: Colorado, New York, Pennsylvania, Texas, Oregon and Connecticut. It reads each state's official open-data registry, published by the Secretary of State or, for Texas, the Comptroller. Every row has the same fields whatever state it came from.

  • Colorado - Colorado Secretary of State - Updated daily
  • New York - NY Department of State (active entities) - Updated daily
  • Pennsylvania - PA Department of State - About 1 week behind
  • Texas - Texas Comptroller, franchise taxpayers - Updated daily
  • Oregon - Oregon Secretary of State (active businesses) - A few days behind
  • Connecticut - CT Secretary of the State - Updated daily

It has three modes: search (by name), newFilings (entities formed in a date range) and lookup (by state ID).

You need a free Apify account and your API token (Console, then Settings, then Integrations). Then run pip install "apify-client>=3" and run this. It checks a list of company names in all six states and writes a CSV:

import csv
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("groupoject/business-entity-search").call(
    run_input={
        "mode": "search",
        "searchTerms": ["blue bottle coffee", "acme roofing"],
        "matchType": "contains", # or "startsWith", "exact"
        "states": ["CO", "NY", "PA", "TX", "OR", "CT"],
        "maxResultsPerState": 10, # per search term, per state
    }
)
columns = ["matchedSearchTerm", "state", "entityId", "name", "category", "status", "isActive", "formationDate", "city", "registeredAgentName", "officialRecordUrl"]
with open("entities.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.writer(f)
    writer.writerow(columns)
    for e in client.dataset(run["default_dataset_id"]).iterate_items():
        city = (e.get("principalAddress") or {}).get("city")
        writer.writerow([e.get("matchedSearchTerm"), e["state"], e["entityId"], e["name"], e.get("category"), e.get("status"), e.get("isActive"), e.get("formationDate"), city, e.get("registeredAgentName"), e.get("officialRecordUrl")])
print("Saved entities.csv")

How the name match works: contains means "contains all words", so starbucks coffee finds "Starbucks Coffee Company". startsWith and exact are stricter. For a KYB check with a known legal name, exact gives the fewest false matches.

If you already have state IDs, use lookup mode with entityIds in STATE:ID form, for example NY:8126668 or TX:32107728928.

What a row looks like

Here is one Colorado row. The name, ID, people and addresses are replaced with placeholders:

{
  "state": "CO",
  "stateName": "Colorado",
  "entityId": "2026XXXXXXX",
  "name": "Example Holdings LLC",
  "entityType": "Domestic Limited Liability Company",
  "entityTypeCode": "DLLC",
  "category": "LLC",
  "domestic": true,
  "jurisdiction": "CO",
  "status": "Good Standing",
  "isActive": true,
  "formationDate": "2026-10-25",
  "county": null,
  "principalAddress": {
    "street": "100 Example St",
    "city": "Thornton",
    "state": "CO",
    "zip": "80233",
    "country": "US"
  },
  "mailingAddress": {
    "street": "200 Example Ave",
    "city": "Westminster",
    "state": "CO",
    "zip": "80031",
    "country": "US"
  },
  "registeredAgentName": "JANE EXAMPLE",
  "registeredAgentAddress": {
    "street": "200 Example Ave",
    "city": "Westminster",
    "state": "CO",
    "zip": "80031",
    "country": "US"
  },
  "people": [],
  "naics": null,
  "officialRecordUrl": "https://www.coloradosos.gov/biz/BusinessEntityDetail.do?masterFileId=2026XXXXXXX",
  "officialSearchUrl": "https://www.coloradosos.gov/biz/BusinessEntityCriteriaExt.do",
  "sourceDataset": "https://data.colorado.gov/d/4ykn-tg5h",
  "sourcePublisher": "Colorado Secretary of State",
  "matchedSearchTerm": null,
  "scrapedAt": "2026-11-07T14:12:03.511Z"
}

category is the normalized type (LLC, Corporation, Nonprofit, Partnership or Other), so you can filter across states. sourceDataset and sourcePublisher tell you exactly where each row came from. Colorado, Oregon and Texas rows also link to the live record on the state's website, so you can double-check before you rely on it.

A daily list of new LLCs

For lead lists, switch to newFilings mode. This returns LLCs formed in the last three days in Denver, and only ones earlier runs haven't returned:

run = client.actor("groupoject/business-entity-search").call(
    run_input={
        "mode": "newFilings",
        "formedWithinDays": 3,
        "states": ["CO"],
        "categories": ["LLC"],
        "cities": ["Denver"],
        "maxResultsPerState": 500,
        "onlyNew": True,
        "stateKey": "denver-new-llcs",
    }
)
for e in client.dataset(run["default_dataset_id"]).iterate_items():
    print(e["formationDate"], e["name"], (e.get("principalAddress") or {}).get("zip"))

Why three days for a daily run? Some registries publish with a delay. A window longer than one day catches late records. onlyNew with a stateKey makes sure you never get, or pay for, the same entity twice. Use a different stateKey for each schedule.

Other filters: zipCodes takes ZIP codes or prefixes such as 802. activeOnly drops dissolved and forfeited entities. formedAfter and formedBefore set a fixed date range.

To run it every morning, save the input as a task in Apify Console and add a schedule under Schedules, then Create. Then connect Google Sheets, HubSpot, Slack or a webhook on the task's Integrations tab.

Contacting people on these records

The data comes from official state open-data registries that are published for public reuse. Business registry records are public. That does not make every use of them lawful. If you contact anyone listed on a record, follow the rules that apply to you, such as CAN-SPAM, the TCPA and state privacy laws.

The registered agent is often a service company, not the owner, so don't treat it as a sales contact. Officers are included only where the state publishes them: Pennsylvania officers and organizers, Oregon authorized representatives, and New York chairmen or CEOs. Owners of LLCs are not public in most states, and the actor returns no email addresses.

What it costs

$1.50 per 1,000 entities on the free plan, with lower rates on paid Apify plans, plus a small start fee per run. Searches that find nothing cost only the start fee, and errors are never charged. Checking 50 company names that return about 300 rows costs about $0.45. Your run's maximum charge is respected: the actor stops before it would go over and keeps what it collected.

Honest limits

  • Six states only. Colorado, New York, Pennsylvania, Texas, Oregon and Connecticut. States are added when they publish an official open-data registry.
  • Some registries list active entities only. New York, Pennsylvania and Oregon publish their current registry. Colorado, Texas and Connecticut include dissolved, withdrawn and forfeited entities; use activeOnly to hide them.
  • Freshness varies. Pennsylvania is about a week behind and Oregon a few days. Don't use them for same-day checks.
  • Texas is tax data. Texas rows come from the Comptroller's franchise taxpayer records, so the status reflects the right to transact business.
  • A registry record is not a full background check. It tells you the entity exists and its filed details. It says nothing about who really owns or controls it.

If you only need one state, use the free script above. The actor is for when you need several states in one schema, name lists, or a daily feed.

Links

Actor: apify.com/groupoject/business-entity-search

If a record looks wrong or a state fails, check the SUMMARY and ERRORS records in the run's key-value store. Then open an issue on the actor's Issues tab with the state and ID. I read them daily.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.