OSHA Enforcement Intelligence MCP — 6M+ Inspection Records avatar

OSHA Enforcement Intelligence MCP — 6M+ Inspection Records

Pricing

$3.00 / 1,000 result item returneds

Go to Apify Store
OSHA Enforcement Intelligence MCP — 6M+ Inspection Records

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

Andrew Avina

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

5 days ago

Last modified

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:

ParameterTypeDescription
establishment_namestringCompany name (partial match). Example: "Amazon", "Tyson"
statestring2-letter state code. Example: "WA", "TX"
naics_codestringNAICS industry code. Example: "336111" (auto mfg)
start_datestringStart of date range (YYYY-MM-DD)
end_datestringEnd of date range (YYYY-MM-DD)
inspection_typestringComplaint, Programmed, Referral, Accident, Unprogrammed
limitintegerMax 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:

ParameterTypeDescription
violation_typestringWillful, Serious, Other, Repeat
statestring2-letter state code
start_datestringStart date (YYYY-MM-DD)
limitintegerMax 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:

ParameterTypeDescription
statestring2-letter state code
naics_prefixstringFirst 2-4 digits of NAICS (e.g., "31" for all manufacturing)
yearintegerCalendar 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

FieldTypeDescription
activity_nrstringUnique OSHA inspection activity number
estab_namestringEstablishment (company) name
site_addressstringStreet address of inspected site
site_citystringCity
site_statestring2-letter state abbreviation
site_zipstringZIP code
naics_codestringNAICS industry code
open_datestringDate inspection was opened (YYYY-MM-DD)
close_datestringDate inspection was closed
insp_typestringInspection type (Complaint, Programmed, Referral, Accident)
total_violationsintegerTotal OSHA citations issued
total_penaltyfloatTotal penalty amount in USD
sourcestringAlways "dol.gov/osha"

Input Parameters

ParameterTypeDefaultDescription
establishment_namestring""Company/establishment name
statestring""2-letter state filter
naics_codestring""NAICS code filter
start_datestring""Start date (YYYY-MM-DD)
end_datestring""End date (YYYY-MM-DD)
inspection_typestring""Inspection type filter
limitinteger25Max results (1–100)
serveMcpbooleanfalseEnable 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 tools
  • POST http://<run-url>:4321/mcp/call — call a tool
  • GET http://<run-url>:4321/health — health check

Data Source

DOL Enforcement Data API

The primary endpoints used:

  • enforcedata.dol.gov/api/osha_inspection — inspection records
  • enforcedata.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

TypeDescriptionTriggered By
ComplaintFormal worker or public complaintEmployee or anonymous tip
ProgrammedPlanned based on targeting criteriaHigh-hazard industry lists
ReferralReferred from another agency/sourceInsurance carriers, other agencies
AccidentFatality or hospitalization of 3+ workersRequired reporting
UnprogrammedUnplanned inspection without complaintFollow-up, monitoring

High-Risk NAICS Codes

Industries most frequently inspected by OSHA:

NAICSIndustry
236220Commercial/Industrial Building Construction
311615Poultry Processing
312120Breweries
336111Automobile Manufacturing
493110General Warehousing & Storage
562212Solid Waste Landfills
238910Site Preparation Contractors
321912Cut Stock, Resawing Lumber
311611Animal (except Poultry) Slaughtering
488119Other Airport Operations

OSHA Penalty Schedule (2024)

Violation TypeMaximum 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.