Government and public records
OSHA Inspections by Company: DOL Data API Lookup
OSHA inspection and citation data is published by the U.S. Department of Labor through its Data API. This Actor looks up inspections by company name or inspection number and returns one record per inspection with its violations and penalties, graded by how well the establishment name matched.
OSHA Inspections by Company + EPA Enforcement Report. Pay per result; see the Store page for current pricing.
The source and its limits
The data comes from the DOL Data API v4 (apiprod.dol.gov), datasets OSHA/inspection and OSHA/violation. It includes federal OSHA and State Plan inspections as DOL publishes them.
The DOL API needs a key. Keys are free: sign in at dataportal.dol.gov, open your account's API keys page, and pass the key as dolApiKey. It is stored as an encrypted secret and only sent to apiprod.dol.gov. Without a key the Actor still runs its EPA source (see EPA ECHO enforcement) and writes one DOL_API_KEY_MISSING item for OSHA.
How name matching works
Agencies record establishment names, not company ids, so every record carries matchConfidence and matchBasis:
high: names equal after removing case, punctuation and suffixes such as Inc or LLC, or an exactosha:identifier lookup.medium: your name is a whole-word prefix of the agency's name ("Tesla" and "TESLA MOTORS INC").low: your words appear elsewhere in the name, or only as part of a word.
minMatchConfidence (default medium) drops weaker matches before they are written or charged, and the summary record lists every distinct matched name separately.
Limits worth knowing
- Inspections come back newest first. A short or generic name scans more rows; add a state or ZIP.
- Agency data lag the agencies' own systems, and statuses and penalties can change after an inspection is first published.
- Each agency has a time budget per run (
timeBudgetSecs, default 300 seconds), at roughly one to three seconds per company.
Fields you get
| Field | What it holds |
|---|---|
recordId, entityName | osha:<activity number> and the establishment name |
address, city, state, zip, naicsCode | Inspection site |
actionDate, closedDate, status | Inspection opened, case closed, and open or closed |
actionType | Inspection type: Complaint, Planned, Accident, Referral, Follow-up and others |
violationCount, violationsByType | Citations, by serious, willful, repeat, other and unclassified |
penaltyUsd, initialPenaltyUsd | Current and initial penalty totals as published |
matchBasis, matchConfidence, matchedName | How the record matched your query |
sourceUrl | The OSHA inspection detail page |
Example output
Shape of one OSHA inspection record (field names from the Actor; the establishment and values are placeholders):
{
"recordType": "inspection",
"agency": "OSHA",
"recordId": "osha:000000000",
"query": "Example Roofing",
"entityName": "EXAMPLE ROOFING LLC",
"address": "100 MAIN ST",
"city": "AUSTIN",
"state": "TX",
"zip": "78701",
"naicsCode": "238160",
"actionDate": "2024-05-14",
"closedDate": null,
"actionType": "Planned",
"status": "open",
"penaltyUsd": 0,
"initialPenaltyUsd": 0,
"violationCount": 1,
"violationsByType": {
"other": 1
},
"lawOrProgram": "OSH Act",
"sourceUrl": "https://www.osha.gov/ords/imis/establishment.inspection_detail?id=000000000",
"matchBasis": "name-exact",
"matchConfidence": "high",
"matchedName": "EXAMPLE ROOFING LLC"
}
Use cases
Supplier and contractor checks
Look up a list of contractors by name and state and read each one's inspection history, violation counts and penalties as published by DOL.
One inspection by number
Pass identifiers: ["osha:316113513"] to fetch a known inspection and its citations.
Weekly watch on a company list
Turn on monitor to write only new or changed inspections (status, penalty or closing date) since the last run, and send them to a webhook.
How to run it
You need an Apify account and its API token (Console → Settings → API & Integrations). Each run is billed per result to your account; set a maximum total charge for the run to cap spend.
With curl
The sync endpoint starts a run, waits up to 300 seconds and returns the dataset items. OSHA inspections since 2021 for two companies in Texas (replace the key placeholder with your own free DOL key):
export APIFY_TOKEN=<your Apify API token>
curl -sS -X POST \
"https://api.apify.com/v2/acts/owlabee~osha-epa-inspections/run-sync-get-dataset-items" \
-H "Authorization: Bearer ${APIFY_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"companies": [
"Acme Roofing",
"Mistras Group"
],
"state": "TX",
"dateFrom": "2021-01-01",
"sources": [
"osha"
],
"dolApiKey": "<your free DOL API key>",
"minMatchConfidence": "medium"
}'
From an AI agent (MCP)
Apify hosts an MCP server. This config exposes only this Actor to the agent:
{
"mcpServers": {
"owlabee-osha-epa-inspections": {
"url": "https://mcp.apify.com/?tools=owlabee/osha-epa-inspections",
"headers": {
"Authorization": "Bearer ${APIFY_TOKEN}"
}
}
}
}
Then ask, for example: Look up OSHA inspections since 2021 for Acme Roofing in Texas, with violation counts, penalties and how confident each name match is.
Python, Node.js and more examples
Runnable curl.sh, python.py, node.mjs and mcp.json files for this Actor are in examples/osha-epa-inspections on GitHub.
FAQ
Why does OSHA need a key when EPA does not?
The DOL Data API does not answer without one. The key is free from dataportal.dol.gov and only used for apiprod.dol.gov.
Why did I get records for a different company?
Agencies record establishment names. Check matchConfidence and matchBasis, raise minMatchConfidence to high, add a state or ZIP, or look up exact identifiers.
Are State Plan inspections included?
Yes, as DOL publishes them in the same datasets.
Is this a rating of the company?
No. Records describe what the agency published, nothing more.
Can I get EPA cases in the same run?
Yes. Add epa to sources. The per-company summary then counts records and penalties by agency.