OSHA Enforcement Intelligence MCP — 6M+ Inspection Records
Pricing
$3.00 / 1,000 result item returneds
OSHA Enforcement Intelligence MCP — 6M+ Inspection Records
Search millions of OSHA workplace safety inspections and violation records directly from your AI assistant. Query by company, state, industry code, date range, and inspection type — with full penalty history.
Pricing
$3.00 / 1,000 result item returneds
Rating
0.0
(0)
Developer
Andrew Avina
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
5 days ago
Last modified
Categories
Share
OSHA Enforcement Intelligence MCP
Search millions of OSHA workplace safety inspections and violation records directly from your AI assistant. Query by company, state, industry code, date range, and inspection type — with full penalty history.
Overview
This Apify Actor exposes OSHA enforcement data from the Department of Labor (DOL) Enforcement Data API through a Model Context Protocol (MCP) server. It enables AI assistants (Claude, GPT-4, Cursor, Continue.dev) to answer real-time questions about workplace safety enforcement history across all US industries.
The actor connects to the DOL's public enforcedata.dol.gov API, normalizes response data into a consistent schema, and handles graceful fallbacks when the API is temporarily unavailable. Every failure path returns a structured _meta error record — the actor never crashes.
Use Cases
EHS Compliance Teams
Screen competitors and industry peers for OSHA enforcement patterns. Identify recurring violation types in your sector and proactively address them before OSHA comes to you.
M&A Due Diligence
Before acquiring a manufacturing, logistics, or food processing company, screen all known facilities for OSHA inspection history. Wilful violations and repeat citations are major red flags that affect valuation and indemnification negotiations.
Workers' Compensation Attorneys
Quickly pull OSHA inspection records for an employer after a workplace injury. Complaint-initiated inspections and citations at the same facility are powerful supporting evidence.
HR & Safety Recruiting
Verify safety culture at prospective employers. A company with a pattern of Willful violations is a very different risk environment than one with occasional Programmed inspections.
Investigative Journalism
Surface the most dangerous workplaces in a state or industry. TRI, OSHA, and EPA data together form a complete picture of corporate environmental and safety records.
Supply Chain Risk
Screen logistics partners, warehousing vendors, and manufacturing contractors for OSHA history before signing contracts.
MCP Tools
search_inspections
Search OSHA inspection records by company name, state, industry, and date range.
Arguments:
| Parameter | Type | Description |
|---|---|---|
establishment_name | string | Company name (partial match). Example: "Amazon", "Tyson" |
state | string | 2-letter state code. Example: "WA", "TX" |
naics_code | string | NAICS industry code. Example: "336111" (auto mfg) |
start_date | string | Start of date range (YYYY-MM-DD) |
end_date | string | End of date range (YYYY-MM-DD) |
inspection_type | string | Complaint, Programmed, Referral, Accident, Unprogrammed |
limit | integer | Max results (default 25, max 100) |
Example query:
{"name": "search_inspections","arguments": {"establishment_name": "Amazon","state": "WA","start_date": "2022-01-01","end_date": "2024-12-31","limit": 10}}
Example response record:
{"activity_nr": "1628394","estab_name": "AMAZON FULFILLMENT CENTER","site_address": "1901 E Sumner Ave","site_city": "Sumner","site_state": "WA","site_zip": "98390","naics_code": "493110","open_date": "2023-03-15","close_date": "2023-05-22","insp_type": "Complaint","total_violations": 4,"total_penalty": 156000.00,"source": "dol.gov/osha"}
When the API is unavailable, the actor returns a structured fallback instead of crashing:
{"_meta": {"error": "All OSHA API endpoints failed or returned non-JSON responses. The DOL Enforcement Data API may be temporarily unavailable. For manual queries visit: https://enforcedata.dol.gov","fallback_tried": true}}
search_violations
Search for OSHA violation citations by severity type, state, and date.
Arguments:
| Parameter | Type | Description |
|---|---|---|
violation_type | string | Willful, Serious, Other, Repeat |
state | string | 2-letter state code |
start_date | string | Start date (YYYY-MM-DD) |
limit | integer | Max results (default 25, max 100) |
Violation types explained:
- Willful — Employer knowingly violated OSHA standards. Maximum penalty $156,259/violation.
- Serious — Substantial probability of death or serious physical harm. Up to $15,625/violation.
- Repeat — Same standard violated again within 5 years. Up to $156,259/violation.
- Other — No direct or immediate relationship to job safety; generally lower risk.
Example query:
{"name": "search_violations","arguments": {"violation_type": "Willful","state": "TX","start_date": "2023-01-01","limit": 20}}
get_inspection_stats
Aggregate OSHA inspection statistics for a state or NAICS industry sector.
Arguments:
| Parameter | Type | Description |
|---|---|---|
state | string | 2-letter state code |
naics_prefix | string | First 2-4 digits of NAICS (e.g., "31" for all manufacturing) |
year | integer | Calendar year (2020–2024) |
Example response:
{"state": "TX","naics_prefix": "31","period": "2023-01-01 to 2023-12-31","total_inspections": 342,"total_violations": 891,"total_penalty_usd": 4820000.0,"avg_penalty_usd": 14094.15,"inspection_types": {"Complaint": 187,"Programmed": 112,"Referral": 31,"Accident": 12},"top_establishments": [{"name": "TYSON FOODS", "inspections": 8},{"name": "JBS USA", "inspections": 6}],"source": "dol.gov/osha"}
Output Schema
| Field | Type | Description |
|---|---|---|
activity_nr | string | Unique OSHA inspection activity number |
estab_name | string | Establishment (company) name |
site_address | string | Street address of inspected site |
site_city | string | City |
site_state | string | 2-letter state abbreviation |
site_zip | string | ZIP code |
naics_code | string | NAICS industry code |
open_date | string | Date inspection was opened (YYYY-MM-DD) |
close_date | string | Date inspection was closed |
insp_type | string | Inspection type (Complaint, Programmed, Referral, Accident) |
total_violations | integer | Total OSHA citations issued |
total_penalty | float | Total penalty amount in USD |
source | string | Always "dol.gov/osha" |
Input Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
establishment_name | string | "" | Company/establishment name |
state | string | "" | 2-letter state filter |
naics_code | string | "" | NAICS code filter |
start_date | string | "" | Start date (YYYY-MM-DD) |
end_date | string | "" | End date (YYYY-MM-DD) |
inspection_type | string | "" | Inspection type filter |
limit | integer | 25 | Max results (1–100) |
serveMcp | boolean | false | Enable MCP server mode |
Modes of Operation
Batch Mode (default)
Run with input parameters. The actor fetches OSHA inspections, normalizes the results, and pushes them to the Apify dataset. Exits when complete.
Best for: Scheduled monitoring, one-time company screening, pipeline automation.
MCP Server Mode (serveMcp: true)
Starts an HTTP server on port 4321 and runs indefinitely.
Best for: Real-time AI assistant queries (Claude Desktop, Cursor, etc.).
Endpoints:
GET http://<run-url>:4321/mcp/tools— list toolsPOST http://<run-url>:4321/mcp/call— call a toolGET http://<run-url>:4321/health— health check
Data Source
DOL Enforcement Data API
- URL: https://enforcedata.dol.gov
- Auth required: None
- Coverage: All OSHA federal enforcement inspections
- Update frequency: Daily
The primary endpoints used:
enforcedata.dol.gov/api/osha_inspection— inspection recordsenforcedata.dol.gov/api/osha_violation— violation citations
Note on API Availability: The DOL Enforcement Data API occasionally returns HTML error pages or 404s during maintenance windows. This actor handles those gracefully with structured fallback responses instead of crashing. If you receive a _meta.error response, the API may be temporarily down — retry in a few minutes.
OSHA Inspection Types
| Type | Description | Triggered By |
|---|---|---|
| Complaint | Formal worker or public complaint | Employee or anonymous tip |
| Programmed | Planned based on targeting criteria | High-hazard industry lists |
| Referral | Referred from another agency/source | Insurance carriers, other agencies |
| Accident | Fatality or hospitalization of 3+ workers | Required reporting |
| Unprogrammed | Unplanned inspection without complaint | Follow-up, monitoring |
High-Risk NAICS Codes
Industries most frequently inspected by OSHA:
| NAICS | Industry |
|---|---|
| 236220 | Commercial/Industrial Building Construction |
| 311615 | Poultry Processing |
| 312120 | Breweries |
| 336111 | Automobile Manufacturing |
| 493110 | General Warehousing & Storage |
| 562212 | Solid Waste Landfills |
| 238910 | Site Preparation Contractors |
| 321912 | Cut Stock, Resawing Lumber |
| 311611 | Animal (except Poultry) Slaughtering |
| 488119 | Other Airport Operations |
OSHA Penalty Schedule (2024)
| Violation Type | Maximum Penalty |
|---|---|
| Serious | $15,625 per violation |
| Other-Than-Serious | $15,625 per violation |
| Willful or Repeat | $156,259 per violation |
| Failure to Abate | $15,625 per day |
Penalties are adjusted annually for inflation. Multi-employer worksites can result in citations for both the controlling employer and the exposing employer.
Example AI Prompts
Once connected via MCP:
- "Search for OSHA inspections of Amazon warehouses in Washington state from 2022 to 2024"
- "Show me all Willful violations in Texas manufacturing during 2023"
- "Get OSHA inspection stats for the poultry processing industry (NAICS 311615) in 2023"
- "Find Complaint-initiated inspections at construction companies in Florida"
- "How many OSHA violations did Tyson Foods receive across all states last year?"
Error Handling
Every error path returns a _meta record — the actor never throws an unhandled exception:
{"_meta": {"error": "human-readable description","fallback_tried": true,"endpoints_tried": ["..."],"suggestion": "manual workaround if available"}}
This ensures downstream AI tools always receive valid JSON, even when the upstream OSHA API is unavailable.
Technical Details
- Language: Python 3.11
- Runtime: Apify Actor SDK v2
- HTTP client: httpx (async, 30s timeout per request)
- MCP server: Pure asyncio TCP — no external web frameworks
- Port: 4321 (MCP server mode)
- Endpoint fallback chain: 3 endpoints tried in order before returning graceful error
- JSON vs HTML detection: Content-Type header + body peek to guard against HTML error pages
License
Data sourced from DOL Enforcement Data, a US federal government public database in the public domain. Actor code is proprietary.