Skip to content

About

Professional license lookup in Python: query Delaware and Colorado licensing rosters by profession, business name or license number, then analyse status, expiry dates and disciplinary flags in pandas. Python example for the Devil Scrapes Apify Actor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

Repository files navigation

Professional License Lookup Scraper β€” DE + CO Roster Export β€” Python example

Professional License Lookup in Python: Delaware and Colorado license rosters to pandas

Run on Apify Python MIT license CI

This repository is a compact, tested Python client for the Professional License Lookup Scraper published by Devil Scrapes on Apify. State licensing boards in Delaware and Colorado publish their rosters of nurses, contractors, real-estate agents, accountants and many other regulated trades as open data, but each state uses its own column names, status codes and date formats. The Actor reads both portals, harmonises the records and returns one row per license: who holds it, which profession and type it belongs to, whether it is current, when it was issued and expires, and whether a disciplinary action is on file. This script starts a run, waits, and writes the rows to results.json and results.csv, so the analysis starts in a notebook instead of in two different state data catalogues.

Actor: Professional License Lookup Scraper β€” DE + CO Roster Export Β· Publisher: Devil Scrapes Β· Also in JavaScript: professional-license-lookup-scraper-javascript

πŸ”₯ What you get

  • Two state rosters behind one schema: Delaware and Colorado name their columns differently and code their statuses differently; every row comes back with the same sixteen keys regardless of which state answered.
  • A status you can filter on: the state's own wording stays in status, and status_normalized sorts it into active, inactive or unknown. Delaware's probation and Colorado's conditional or provisional licenses count as active.
  • Discipline taken from where each state actually records it: Colorado marks it on the license record itself, while Delaware keeps it in a separate disposition dataset that the Actor joins in, keeping the most recent disposition text.
  • Three ways to narrow a pull: a profession phrase, a fragment of the name on file (a firm, an agency, a practice) or an exact license number. Leave all three empty to walk the full roster.
  • Colorado license codes translated: the state publishes short prefixes on each license, and the Actor looks them up in Colorado's own code table so profession and license_type read as words.
  • One failing state does not end the run: transient errors and rate limits are retried with growing pauses, and a state that still fails is logged and skipped while the other one finishes.

🎯 Use cases

Count the licensed workforce by profession and city

Workforce planners and staffing firms can pull every active license for a profession in one state, then group by city and license_type. The result is a supply map built from the regulator's own register, which is far more defensible in a report than a figure scraped from job ads.

Forecast renewal waves for a compliance calendar

Licenses tend to expire in batches tied to a board's renewal cycle. Parse expiration_date, bucket it by month and you can see when a cohort of contractors or agencies you depend on will need to renew, months before anything lapses.

Screen vendors and contracting firms for discipline

Run the Actor with disciplinaryOnly switched on and a profession phrase such as roofing, then join the output to your vendor master file on license number. Anything with disciplinary_flag set goes to a human reviewer along with the disposition text from disciplinary_detail.

⚑ Quick start

You need an Apify account and an API token from Console β†’ Settings β†’ Integrations. Apify's free plan includes monthly usage credit; this Actor's event prices are listed under Pricing below.

git clone https://github.com/devilscrapes/professional-license-lookup-scraper-python.git
cd professional-license-lookup-scraper-python
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export APIFY_TOKEN=your_token_here
python main.py                      # uses input.json
python main.py my-input.json --out data --max-charge 2

The script starts the Professional License Lookup Scraper β€” DE + CO Roster Export, waits for it to finish, prints a link to the run in Apify Console and saves every result to results.json and results.csv. It exits with code 1 and the run's status message if the run fails.

🧩 The core call

Stripped of the command-line handling, the integration is the snippet below. apify-client starts the Actor, blocks until the run is finished and then iterates over the dataset, fetching it page by page behind the scenes.

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("DevilScrapes/professional-license-lookup-scraper").call(run_input={'jurisdictions': ['DE', 'CO'], 'professionQuery': 'nursing', 'activeOnly': True, 'disciplinaryOnly': False, 'maxResults': 10, 'proxyConfiguration': {'useApifyProxy': False}})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

πŸ“₯ Input

main.py hands input.json to the Actor without changes. The bundled input looks up active nursing licenses in both states and stops after ten rows, which costs a few cents and finishes quickly. Because the row cap is shared across states and Delaware is listed first, those ten rows will usually all come from Delaware; put CO alone in jurisdictions to see Colorado records. Use nameQuery with the name of a firm or agency, or licenseNumber for one specific license.

{
  "jurisdictions": [
    "DE",
    "CO"
  ],
  "professionQuery": "nursing",
  "activeOnly": true,
  "disciplinaryOnly": false,
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
Field Type Required Default Allowed values
jurisdictions array no ["DE", "CO"] β€”
professionQuery string no "nursing" β€”
nameQuery string no β€” β€”
licenseNumber string no β€” β€”
activeOnly boolean no true β€”
disciplinaryOnly boolean no false β€”
maxResults integer no 500 β€”
proxyConfiguration object no {"useApifyProxy": false} β€”

πŸ“€ Output

Each record is a single license in a single state. Dates are already trimmed to YYYY-MM-DD, so pd.to_datetime parses them without a format string. Optional fields that a state leaves blank arrive as nulls, which pandas reads as missing values rather than empty strings.

Field Type Always present
jurisdiction string yes
licensee_name string yes
license_number string yes
profession string yes
license_type string or null no
status string or null no
status_normalized string yes
issue_date string or null no
expiration_date string or null no
disciplinary_flag boolean yes
disciplinary_detail string or null no
city string or null no
mailing_state string or null no
source_record_url string yes
registry_url string yes
scraped_at string yes

πŸ’° Pricing

Event Price (USD)
Actor start $0.2
Result row emitted $0.005

Prices as configured on 2026-08-20. The Actor page always shows the current price. Runs are billed to the Apify account that owns the token. Use --max-charge to cap what a single run can cost.

πŸ› οΈ Working with the data in Python

The snippet below needs pandas (pip install pandas). It summarises licenses and disciplinary flags per state and profession, then writes the active licenses that expire within the next 90 days to a CSV you can hand to whoever owns renewals.

import json
from datetime import date, timedelta

import pandas as pd

df = pd.DataFrame(json.load(open("results.json", encoding="utf-8")))
df["expiration_date"] = pd.to_datetime(df["expiration_date"], errors="coerce")

horizon = pd.Timestamp(date.today() + timedelta(days=90))
renewals = df[(df["status_normalized"] == "active") & (df["expiration_date"] <= horizon)]

summary = (
    df.groupby(["jurisdiction", "profession"])
    .agg(licenses=("license_number", "count"), disciplined=("disciplinary_flag", "sum"))
    .sort_values("licenses", ascending=False)
)
print(summary.head(15).to_string())
columns = ["jurisdiction", "licensee_name", "license_number", "license_type", "expiration_date"]
renewals.sort_values("expiration_date")[columns].to_csv("renewals_next_90_days.csv", index=False)
print(f"{len(renewals)} active licenses expire within 90 days")

❓ FAQ

Which states and professions does it cover?

Delaware and Colorado. Within those two states it covers whatever the licensing boards publish in their open-data rosters, which spans health care, real estate, construction trades, accountancy and many other professions. Attorneys are not included, because bar admission is run by a different body.

How does the profession phrase match in each state?

In Delaware the phrase is matched, case-insensitively, inside the profession field of each license. In Colorado it is matched against the state's table of license categories and types, and the matching license codes are then used as the filter. If the phrase matches no Colorado category, the Colorado part of the run is not narrowed by profession, so look at the profession column before you trust a count.

Why can a license number return more than one row?

Colorado numbers are only unique within a license prefix, so the same digits can belong to licenses in different professions. Use jurisdiction, license_number and license_type together as your key.

What happens when nothing matches?

The run ends as failed, and its status message repeats the filters you used, which makes a mistyped phrase easy to spot. Only the start fee is charged. The script exits with code 1, so a cron job or Airflow task can raise an alert.

🧯 Troubleshooting

  • Set APIFY_TOKEN first: export the token in the same shell, or put it in a local .env file your shell loads. Never commit it.
  • Run finished with FAILED or ABORTED: open the printed Console link; the run log says why. Input validation errors name the field.
  • Fewer rows than expected: a --max-charge cap also limits how many results can be charged. Raise the cap or lower the limits in your input.
  • Something looks wrong in the data: open an issue on the Actor page so the maintainers see it.

πŸ”— More from Devil Scrapes

Related Actors:


MIT licensed example code. The Actor itself runs on Apify and is maintained by Devil Scrapes. Not affiliated with the State of Delaware, the State of Colorado or their licensing boards.

About

Professional license lookup in Python: query Delaware and Colorado licensing rosters by profession, business name or license number, then analyse status, expiry dates and disciplinary flags in pandas. Python example for the Devil Scrapes Apify Actor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages