# OSHA Workplace Safety Inspections Scraper (`compute-edge/osha-inspections-scraper`) Actor

Scrapes OSHA workplace safety inspection data including violations, penalties, and establishment details from the OSHA IMIS system.

- **URL**: https://apify.com/compute-edge/osha-inspections-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Automation, Lead generation, Jobs
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

Extract **workplace safety inspection data** from the **Occupational Safety and Health Administration (OSHA)** — the definitive source for **workplace inspections**, **safety violations**, and **penalty data** in the United States. This Actor scrapes the official OSHA IMIS (Integrated Management Information System) to deliver structured data on millions of workplace inspections conducted under federal occupational safety law.

OSHA data is essential for **workplace safety compliance monitoring**, **insurance risk assessment**, **supply chain due diligence**, **legal research**, and **investigative journalism**. Every employer in the US is subject to OSHA inspections. This Actor makes inspection records, violation details, and penalty amounts instantly accessible in JSON, CSV, or Excel format.

### Key Features

| Feature | Description |
|---------|-------------|
| **Establishment search** | Search by company name with partial matching |
| **State filtering** | Filter by US state abbreviation (CA, TX, NY, etc.) |
| **NAICS code filtering** | Filter by industry classification code |
| **Full inspection details** | Optionally fetch violations, penalties, site address, and union status |
| **Penalty tracking** | Initial and current penalty amounts for each inspection |
| **No authentication** | Uses freely available OSHA public data — no API key needed |

### What Data Can You Extract?

| Field | Description |
|-------|-------------|
| `activityNumber` | OSHA inspection activity number |
| `dateOpened` | Date the inspection was opened |
| `establishmentName` | Name of the inspected company |
| `state` | US state where inspection occurred |
| `inspectionType` | Type of inspection (Planned, Complaint, Referral, etc.) |
| `scope` | Inspection scope (Complete, Partial) |
| `sicCode` | Standard Industrial Classification code |
| `naicsCode` | North American Industry Classification code |
| `siteAddress` | Street address of inspected site |
| `city`, `stateCode`, `zipCode` | Full location details |
| `unionStatus` | Whether the workplace is unionized |
| `initialPenalty` | Total initial penalty amount in dollars |
| `currentPenalty` | Total current penalty after adjustments |
| `violationsSummary` | Breakdown by type: serious, willful, repeat, other |
| `violations` | Individual violation items with citation ID, standard, and penalty |
| `inspectionDetailUrl` | Direct link to the OSHA inspection detail page |

### How to Scrape OSHA Inspection Data

1. **Go to this Actor's page** on the Apify Store
2. **Click "Start"** to open the input form
3. **Set your filters:**
   - Enter an **Establishment Name** (e.g., `Walmart`, `Amazon`) — partial match supported
   - Enter a **State** code (e.g., `TX`) — or leave blank for all states
   - Enter a **NAICS Code** (e.g., `236220` for commercial construction) — optional
   - Toggle **Include Inspection Details** for full violation and penalty data
   - Set **Max Results** (default: 100; max: 10,000)
4. **Click "Start"** to run the Actor
5. **Download your data** in JSON, CSV, or Excel format from the Dataset tab

### Input Example

```json
{
    "establishment": "Walmart",
    "state": "TX",
    "includeDetails": true,
    "maxResults": 50
}
````

### Output Example

```json
{
    "activityNumber": "1685163",
    "dateOpened": "01/15/2024",
    "establishmentName": "WAL-MART ASSOCIATES INC",
    "state": "TX",
    "inspectionType": "Complaint",
    "scope": "Partial",
    "naicsCode": "452311",
    "siteAddress": "1234 MAIN ST",
    "city": "HOUSTON",
    "stateCode": "TX",
    "zipCode": "77001",
    "unionStatus": "NonUnion",
    "initialPenalty": 15625,
    "currentPenalty": 15625,
    "violationsSummary": {
        "serious": 1,
        "willful": 0,
        "repeat": 0,
        "other": 0,
        "unclassified": 0
    },
    "violations": [
        {
            "citationId": "01001",
            "citationType": "Serious",
            "standard": "19100303",
            "issuanceDate": "07/15/2024",
            "abatementDate": "08/15/2024",
            "currentPenalty": "$15,625.00"
        }
    ],
    "inspectionDetailUrl": "https://www.osha.gov/ords/imis/establishment.inspection_detail?id=1685163"
}
```

### Pricing

This Actor uses **pay-per-result** pricing:

| Event | Price |
|-------|-------|
| Actor start | $0.00005 |
| Per result | $0.002 |

OSHA data is free and public. You only pay for Apify compute resources plus the per-result fee above. A typical run of 100 inspections with details costs approximately $0.20 in Actor fees plus minimal compute costs.

### Use Cases

- **Workplace Safety Compliance**: Monitor inspection history and violations for specific companies or industries
- **Insurance Risk Assessment**: Evaluate employer safety records for underwriting and premium calculations
- **Supply Chain Due Diligence**: Screen vendors and contractors for safety violations before engagement
- **Legal Research**: Find inspection and violation data for workplace injury litigation
- **Investigative Journalism**: Data-driven reporting on workplace safety enforcement trends
- **HR & EHS Consulting**: Benchmark client safety records against industry peers

### Integrations

Connect this Actor to your existing workflows:

- Export to **Google Sheets** for collaborative analysis
- Send results to **Slack** or **email** for automated alerts
- Feed into **Zapier**, **Make**, or **n8n** for custom automation
- Use the Apify API to integrate directly with your application

### FAQ

#### Is it legal to scrape OSHA inspection data?

Yes. OSHA inspection data is publicly available through the OSHA IMIS system, a free public service provided by the U.S. Department of Labor. The data is in the public domain and freely available for any use.

#### How much does it cost to scrape OSHA?

The Actor charges $0.002 per result plus a $0.00005 Actor start fee. A typical run of 100 inspections with details costs approximately $0.20 in Actor fees plus minimal compute costs. See the pricing table above for details.

#### Can I export OSHA data to Excel or CSV?

Yes. Apify supports exporting data in JSON, CSV, Excel, XML, HTML, and RSS formats. After the Actor run completes, go to the Dataset tab and choose your preferred export format.

#### How often is the OSHA data updated?

You can schedule this Actor to run at any interval — daily, weekly, or monthly. OSHA updates the IMIS database as inspections are conducted and violations are issued, reflecting near real-time enforcement activity.

#### What does "Include Inspection Details" do?

When enabled, the Actor fetches the full detail page for each inspection, extracting site address, union status, individual violation items, and penalty amounts. This provides significantly richer data but is slower since it visits each inspection's detail page.

### Other Scrapers by SeatSignal

- [MSHA Mine Safety Scraper](https://apify.com/seatsignal/msha-mine-safety-scraper) — Extract mine safety data for 91K+ US mines
- [EPA ECHO Environmental Compliance Scraper](https://apify.com/seatsignal/epa-echo-scraper) — Extract compliance data for 800K+ EPA-regulated facilities
- [EPA Toxics Release Inventory (TRI) Scraper](https://apify.com/seatsignal/epa-tri-scraper) — Extract toxic chemical release data from EPA TRI
- [CPSC Product Recalls Scraper](https://apify.com/seatsignal/cpsc-product-recalls-scraper) — Extract consumer product recall data from CPSC
- [NHTSA Vehicle Safety Scraper](https://apify.com/seatsignal/nhtsa-vehicle-safety-scraper) — Extract vehicle safety complaints and recall data

### Legal Disclaimer

This Actor accesses publicly available data from the OSHA IMIS system, a free public service provided by the U.S. Department of Labor. The data is in the public domain and freely available for any use.

This Actor does not bypass any authentication, does not violate any terms of service, and respects server resources with built-in request delays. The Actor is provided as-is without warranty. Users are responsible for ensuring their use of the data complies with applicable laws and regulations.

For questions or support, please open an issue on this Actor's page.

# Actor input Schema

## `establishment` (type: `string`):

Company or establishment name to search for (partial match supported).

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

Two-letter state code to filter by (e.g., CA, TX, NY). Leave empty for all states.

## `naicsCode` (type: `string`):

NAICS industry code to filter by (e.g., 236220 for commercial construction).

## `includeDetails` (type: `boolean`):

Fetch full inspection details for each result (slower but more data including violations and penalties).

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

Maximum number of inspections to return.

## Actor input object example

```json
{
  "establishment": "",
  "state": "",
  "naicsCode": "",
  "includeDetails": true,
  "maxResults": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("compute-edge/osha-inspections-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("compute-edge/osha-inspections-scraper").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 '{}' |
apify call compute-edge/osha-inspections-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=compute-edge/osha-inspections-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OSHA Workplace Safety Inspections Scraper",
        "description": "Scrapes OSHA workplace safety inspection data including violations, penalties, and establishment details from the OSHA IMIS system.",
        "version": "1.0",
        "x-build-id": "zAWkavEulLJWQphNw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~osha-inspections-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-osha-inspections-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/compute-edge~osha-inspections-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-osha-inspections-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/compute-edge~osha-inspections-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-osha-inspections-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "establishment": {
                        "title": "Establishment Name",
                        "type": "string",
                        "description": "Company or establishment name to search for (partial match supported).",
                        "default": ""
                    },
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Two-letter state code to filter by (e.g., CA, TX, NY). Leave empty for all states.",
                        "default": ""
                    },
                    "naicsCode": {
                        "title": "NAICS Code",
                        "type": "string",
                        "description": "NAICS industry code to filter by (e.g., 236220 for commercial construction).",
                        "default": ""
                    },
                    "includeDetails": {
                        "title": "Include Inspection Details",
                        "type": "boolean",
                        "description": "Fetch full inspection details for each result (slower but more data including violations and penalties).",
                        "default": true
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of inspections to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
