# OSHA Accident & Injury Intelligence (`ryanclinton/osha-accident-intel`) Actor

Search OSHA workplace accident investigations with incident narratives, injury demographics, fall data, chemical exposures, emphasis programs, and risk scoring.

- **URL**: https://apify.com/ryanclinton/osha-accident-intel.md
- **Developed by:** [ryan clinton](https://apify.com/ryanclinton) (community)
- **Categories:** Other, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$30.00 / 1,000 result returneds

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 Accident & Injury Intelligence

Search OSHA workplace accident investigations with incident narratives, injury demographics, fall data, chemical exposures, emphasis programs, and risk scoring.

### What does this actor do?

This actor searches the DOL (Department of Labor) OSHA accident investigation database and joins up to 7 related datasets to build comprehensive accident case records:

1. **Accident cases** — Core investigation data: employer, location, date, event type, fatality/hospitalization/amputation flags
2. **Accident abstracts** — Full narrative text describing what happened in each incident
3. **Accident injuries** — Individual injury records with demographics (age, sex), occupation, nature of injury, body part, source of injury, fall distances
4. **Related activities** — Connected inspection activities for the same employer/site
5. **Emphasis codes** — Active OSHA emphasis programs (e.g., Falls, Trenching, PSM Chemical Facilities)
6. **Violation general duty standard** — Section 5(a)(1) citations for novel hazards with no specific standard

Each accident case is enriched with a **risk score** (0–100+) based on fatalities, hospitalizations, amputations, mass casualties, fall heights, emphasis programs, general duty citations, and minor workers.

### Input parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `apiKey` | string | DOL API key (free at https://dataportal.dol.gov/registration) |
| `dryRun` | boolean | Return sample data without API calls (default: true unless apiKey provided) |
| `companyName` | string | Search by employer name (partial match) |
| `state` | string | Two-letter state abbreviation |
| `city` | string | Search by city name (partial match) |
| `naicsCode` | string | NAICS industry code prefix (e.g., "23" for construction) |
| `dateFrom` | string | Filter from date (YYYY-MM-DD) |
| `dateTo` | string | Filter to date (YYYY-MM-DD) |
| `fatalitiesOnly` | boolean | Only cases with fatalities |
| `hospitalizationsOnly` | boolean | Only cases with hospitalizations |
| `keyword` | string | Event keyword: Fall, Chemical, Struck, Caught, Electrocution, etc. |
| `includeNarratives` | boolean | Join narrative text (default: true) |
| `includeInjuryDetails` | boolean | Join detailed injury records (default: true) |
| `includeRelatedInspections` | boolean | Join related inspections, emphasis, and general duty (default: false) |
| `maxResults` | integer | Max accident cases (1–5000, default: 100) |
| `maxInjuriesPerAccident` | integer | Max injury records per case (1–200, default: 50) |

### Output format

Each record includes:

```json
{
    "summaryNumber": "202451234",
    "eventDate": "2024-09-15",
    "eventDescription": "Employee fell from scaffolding",
    "eventKeyword": "Fall",
    "employerName": "SUMMIT CONSTRUCTION LLC",
    "siteCity": "HOUSTON",
    "siteState": "TX",
    "naicsCode": "236220",
    "isFatality": true,
    "numberOfFatalities": 1,
    "numberOfHospitalizations": 0,
    "numberOfInjuries": 1,
    "narrative": "At approximately 10:30 AM, an employee was working on a scaffold...",
    "injuries": [
        {
            "age": 34,
            "sex": "M",
            "degreeOfInjury": "1",
            "degreeDescription": "Fatality",
            "natureOfInjury": "Fractures",
            "partOfBody": "Head",
            "sourceOfInjury": "Floor, ground surfaces",
            "eventType": "Fall to lower level",
            "fallHeight": 35,
            "occupation": "Construction laborer"
        }
    ],
    "injurySummary": {
        "total": 1,
        "fatalities": 1,
        "averageAge": 34,
        "maleCount": 1,
        "topNatureOfInjury": "Fractures",
        "fallRelated": 1
    },
    "emphasisPrograms": [
        { "programType": "N", "programValue": "Falls" }
    ],
    "riskScore": 70,
    "riskLevel": "High",
    "riskFactors": [
        "1 fatality(ies) (+40)",
        "Fall from 35+ feet (+15)",
        "1 emphasis program(s) active (+5)"
    ]
}
````

### Risk scoring

Each accident case receives a composite risk score:

| Factor | Points |
|--------|--------|
| Fatality | +40 per fatality |
| Hospitalization | +15 each (max 60) |
| Amputation | +25 |
| Multiple injuries (2–5) | +10 |
| Mass casualty (6+) | +20 |
| Fall from >20 feet | +15 |
| Fall-related injury | +8 |
| Emphasis program active | +5 each (max 15) |
| General duty (5a1) citation | +10 |
| Minor worker (<18) | +20 |

**Risk levels:** Critical (80+), High (50–79), Medium (25–49), Low (<25)

### Use cases

- **Safety consultants**: Analyze accident patterns by industry, location, and event type
- **Insurance underwriters**: Assess workplace risk profiles for employers and industries
- **Legal researchers**: Find accident investigations with narratives for litigation research
- **Compliance teams**: Monitor industry peers for accident trends and emphasis programs
- **EHS professionals**: Benchmark safety performance against industry data
- **Journalists**: Investigate workplace safety patterns and mass casualty events
- **Supply chain risk**: Screen suppliers and contractors for workplace safety records

### API key

This actor uses the DOL Open Data Portal API. Register for a free key at https://dataportal.dol.gov/registration

Without an API key, the actor returns realistic sample data in dry run mode.

### Data sources

All data comes from the U.S. Department of Labor OSHA public datasets:

- `OSHA/accident` — Accident investigation cases
- `OSHA/accident_abstract` — Investigation narrative text
- `OSHA/accident_injury` — Individual injury records with demographics
- `OSHA/related_activity` — Connected inspection activities
- `OSHA/emphasis_codes` — Emphasis program designations
- `OSHA/violation_gen_duty_std` — General duty standard citations

# Actor input Schema

## `apiKey` (type: `string`):

Your DOL Open Data Portal API key. Register free at https://dataportal.dol.gov/registration

## `dryRun` (type: `boolean`):

Return sample data without calling the API. Default: true (unless apiKey provided)

## `companyName` (type: `string`):

Search by employer name (partial match)

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

Two-letter state abbreviation

## `city` (type: `string`):

Search by city name (partial match)

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

Industry NAICS code (prefix match). e.g., '23' for construction, '31-33' for manufacturing

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

Filter accidents from this date (YYYY-MM-DD)

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

Filter accidents up to this date (YYYY-MM-DD)

## `fatalitiesOnly` (type: `boolean`):

Only return cases involving fatalities

## `hospitalizationsOnly` (type: `boolean`):

Only return cases involving hospitalizations (ignored if fatalitiesOnly is set)

## `keyword` (type: `string`):

Search by event keyword. e.g., 'Fall', 'Chemical', 'Struck', 'Caught', 'Electrocution'

## `includeNarratives` (type: `boolean`):

Join incident narrative text from accident abstracts

## `includeInjuryDetails` (type: `boolean`):

Join detailed injury records (age, sex, occupation, body part, nature of injury)

## `includeRelatedInspections` (type: `boolean`):

Join related inspection activities, emphasis programs, and general duty citations

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

Maximum number of accident cases to return (1-5000)

## `maxInjuriesPerAccident` (type: `integer`):

Maximum injury records to fetch per accident case (1-200)

## Actor input object example

```json
{
  "dryRun": true,
  "fatalitiesOnly": false,
  "hospitalizationsOnly": false,
  "includeNarratives": true,
  "includeInjuryDetails": true,
  "includeRelatedInspections": false,
  "maxResults": 100,
  "maxInjuriesPerAccident": 50
}
```

# Actor output Schema

## `results` (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("ryanclinton/osha-accident-intel").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("ryanclinton/osha-accident-intel").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 ryanclinton/osha-accident-intel --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OSHA Accident & Injury Intelligence",
        "description": "Search OSHA workplace accident investigations with incident narratives, injury demographics, fall data, chemical exposures, emphasis programs, and risk scoring.",
        "version": "0.1",
        "x-build-id": "ofFShUL0Y4cCyrEcS"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ryanclinton~osha-accident-intel/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ryanclinton-osha-accident-intel",
                "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/ryanclinton~osha-accident-intel/runs": {
            "post": {
                "operationId": "runs-sync-ryanclinton-osha-accident-intel",
                "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/ryanclinton~osha-accident-intel/run-sync": {
            "post": {
                "operationId": "run-sync-ryanclinton-osha-accident-intel",
                "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": {
                    "apiKey": {
                        "title": "DOL API Key",
                        "type": "string",
                        "description": "Your DOL Open Data Portal API key. Register free at https://dataportal.dol.gov/registration"
                    },
                    "dryRun": {
                        "title": "Dry Run",
                        "type": "boolean",
                        "description": "Return sample data without calling the API. Default: true (unless apiKey provided)",
                        "default": true
                    },
                    "companyName": {
                        "title": "Company Name",
                        "type": "string",
                        "description": "Search by employer name (partial match)"
                    },
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Two-letter state abbreviation"
                    },
                    "city": {
                        "title": "City",
                        "type": "string",
                        "description": "Search by city name (partial match)"
                    },
                    "naicsCode": {
                        "title": "NAICS Code",
                        "type": "string",
                        "description": "Industry NAICS code (prefix match). e.g., '23' for construction, '31-33' for manufacturing"
                    },
                    "dateFrom": {
                        "title": "Date From",
                        "type": "string",
                        "description": "Filter accidents from this date (YYYY-MM-DD)"
                    },
                    "dateTo": {
                        "title": "Date To",
                        "type": "string",
                        "description": "Filter accidents up to this date (YYYY-MM-DD)"
                    },
                    "fatalitiesOnly": {
                        "title": "Fatalities Only",
                        "type": "boolean",
                        "description": "Only return cases involving fatalities",
                        "default": false
                    },
                    "hospitalizationsOnly": {
                        "title": "Hospitalizations Only",
                        "type": "boolean",
                        "description": "Only return cases involving hospitalizations (ignored if fatalitiesOnly is set)",
                        "default": false
                    },
                    "keyword": {
                        "title": "Event Keyword",
                        "type": "string",
                        "description": "Search by event keyword. e.g., 'Fall', 'Chemical', 'Struck', 'Caught', 'Electrocution'"
                    },
                    "includeNarratives": {
                        "title": "Include Narratives",
                        "type": "boolean",
                        "description": "Join incident narrative text from accident abstracts",
                        "default": true
                    },
                    "includeInjuryDetails": {
                        "title": "Include Injury Details",
                        "type": "boolean",
                        "description": "Join detailed injury records (age, sex, occupation, body part, nature of injury)",
                        "default": true
                    },
                    "includeRelatedInspections": {
                        "title": "Include Related Inspections",
                        "type": "boolean",
                        "description": "Join related inspection activities, emphasis programs, and general duty citations",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of accident cases to return (1-5000)",
                        "default": 100
                    },
                    "maxInjuriesPerAccident": {
                        "title": "Max Injuries Per Accident",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum injury records to fetch per accident case (1-200)",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
