# OSHA Inspections & Violations Scraper - Penalty API (`pink_comic/osha-workplace-inspection-violations`) Actor

Search official OSHA IMIS workplace inspections by activity number, employer, state, ZIP, date, case status, violations, inspection type, and NAICS. Export source-linked citations, standards, penalties, addresses, ownership, office, and case evidence.

- **URL**: https://apify.com/pink\_comic/osha-workplace-inspection-violations.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Business
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## OSHA Inspections & Violations Scraper — Penalty API

Search official U.S. Occupational Safety and Health Administration inspection records by exact activity number, employer, state, site ZIP, opened date, case status, violation status, inspection type, and NAICS industry.

The actor reads OSHA's public Integrated Management Information System (IMIS) establishment search and inspection-detail pages. It returns source-linked employer, inspection, citation, standard, penalty, office, address, ownership, and case evidence for workplace-safety due diligence, supplier and contractor screening, insurance risk review, compliance research, legal research, and enforcement leads. No login, API key, browser, or proxy is required.

### Fast start

The default searches Amazon and enriches the 10 newest matching records from their official inspection pages:

```json
{
  "employer": "Amazon",
  "fetchDetails": true,
  "maxResults": 10
}
```

Inspect one exact OSHA activity number:

```json
{
  "activityNumber": "1774072.015",
  "fetchDetails": true,
  "maxResults": 1
}
```

Find Texas construction inspections with listed violations:

```json
{
  "employer": "",
  "state": "TX",
  "naics": "23",
  "violationsStatus": "yes",
  "dateFrom": "2025-01-01",
  "dateTo": "2026-12-31",
  "fetchDetails": true,
  "maxResults": 100
}
```

Find open fatality/catastrophe inspections for one employer:

```json
{
  "employer": "Tyson Foods",
  "inspectionType": "Fat/Cat",
  "caseStatus": "open",
  "fetchDetails": true,
  "maxResults": 50
}
```

### Search fields

- exact OSHA inspection activity number
- employer or establishment name, using OSHA's public wildcard search
- state or territory
- exact five-digit site ZIP
- opened-date range
- open, closed, or all cases
- with violations, without violations, or all inspections
- case-insensitive inspection-type substring
- 2–6 digit NAICS code or industry prefix
- 1–500 total output records

`inspectionType` and `naics` are applied to the official result rows. The actor scans a bounded maximum of 2,000 newest source rows to find filtered matches and stops at `maxResults`.

Set `fetchDetails` to `false` for a faster result-list export. Keep it `true` to retrieve addresses, ownership, office, case status, violation totals, penalties, cited standards, citation items, and related activities.

### Output

Every found record exposes 46 stable top-level keys, including:

- OSHA activity number, report ID, employer, office, and official record URL
- site and mailing addresses, city, state, and ZIP
- opened, closed, and close-conference dates
- case status, inspection type/scope, safety or health classification, ownership, union status, advance notice, and emphasis programs
- NAICS and SIC codes and descriptions when OSHA reports them
- current and initial violation totals
- serious, willful, repeat, other, and unclassified violation counts
- current, initial, and failure-to-abate penalty totals
- citation IDs, citation types, cited standards, issue and abatement dates, penalties, contest state, latest event, notes, and source links
- related complaint, referral, inspection, or other activity
- retrieval timestamp, source agency/system, warnings, and interpretation caveat

Valid searches with no source rows return one explicit `no_match` evidence record rather than an ambiguous empty dataset. If the official OSHA pages remain unavailable after bounded retries, the actor returns an explicit `source_unavailable` record.

### Important interpretation limits

OSHA states that IMIS was designed as an internal agency management tool. Information comes from the local federal or state office and is entered as events occur.

- Open inspections are especially dynamic.
- Citations, classifications, violations, and penalties may change through corrections, amended citations, settlements, and contest proceedings.
- Different companies can have similar names; compare addresses before linking a record to a legal entity.
- A no-match result does not prove an employer has never been inspected or has no workplace-safety issues.
- IMIS is not a final adjudication, certified case file, complete employer safety rating, or substitute for legal/compliance review.

Use this actor for discovery and screening. Verify consequential underwriting, employment, procurement, compliance, legal, or safety decisions against the linked record, underlying case file, and originating OSHA or state-plan office.

### Official sources

- [OSHA establishment search](https://www.osha.gov/ords/imis/establishment.html)
- [OSHA public data overview](https://www.osha.gov/data)
- [OSHA establishment-search interpretation guidance](https://www.osha.gov/help/establishment-search)

# Actor input Schema

## `activityNumber` (type: `string`):

Fetch one exact inspection, such as 1774072.015. When set, it takes priority over broad search fields.

## `employer` (type: `string`):

Official OSHA wildcard name search, such as Amazon, Tesla, Tyson Foods, or a contractor name. OSHA warns that similar names can refer to different companies.

## `state` (type: `string`):

Optional two-letter site state or territory code.

## `siteZip` (type: `string`):

Optional exact five-digit inspection-site ZIP code.

## `inspectionType` (type: `string`):

Optional case-insensitive result filter such as Complaint, Planned, Referral, Accident, or Fat/Cat.

## `naics` (type: `string`):

Optional 2-6 digit industry-code prefix, such as 23 for construction or 493110 for general warehousing.

## `caseStatus` (type: `string`):

Search all cases, only currently open cases, or only closed cases.

## `violationsStatus` (type: `string`):

Search all inspections, only inspections with violations, or only inspections without listed violations.

## `dateFrom` (type: `string`):

Optional inclusive YYYY-MM-DD start date.

## `dateTo` (type: `string`):

Optional inclusive YYYY-MM-DD end date.

## `fetchDetails` (type: `boolean`):

Fetch each official detail page for addresses, ownership, case status, penalty totals, standards, citation items, and related activities.

## `maxResults` (type: `integer`):

Total output cap after inspection-type and NAICS filtering.

## Actor input object example

```json
{
  "employer": "Amazon",
  "caseStatus": "all",
  "violationsStatus": "all",
  "fetchDetails": true,
  "maxResults": 10
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "employer": "Amazon",
    "fetchDetails": true,
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/osha-workplace-inspection-violations").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "employer": "Amazon",
    "fetchDetails": True,
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/osha-workplace-inspection-violations").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "employer": "Amazon",
  "fetchDetails": true,
  "maxResults": 10
}' |
apify call pink_comic/osha-workplace-inspection-violations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pink_comic/osha-workplace-inspection-violations",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/lWkGgoX8c4BQZUYvj/builds/wiZ8AaOiAfx7clKYW/openapi.json
