# OSHA API

> OSHA workflow and API: inspections. Returns inspections, city, scope and state as JSON.

OSHA data from osha.gov: inspections.

- Page: https://fous.com/tools/osha
- Handle: `@osha`
- Category: [Government](https://fous.com/tools/category/government)
- Source website: https://osha.gov
- Last verified: Sep 29, 2026

## Methods

### Search inspections

Operation `search_inspections`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find OSHA workplace inspections for a company, with site addresses, violations, penalties, industry and case status. Results include publicly posted information; recent citations and penalties may not yet be available.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `state` | string | no | `"TN"` | State name or two-letter code, for example Tennessee or TN. |
| `status` | string | no | `"closed"` | Case status to include, for example closed. |
| `company` | string | yes | `"Tyson Foods"` | Company or establishment name, for example Tyson Foods. |
| `start_date` | string | no |  | Earliest inspection date in YYYY-MM-DD, for example 2022-01-01. Defaults to five years ago. |
| `max_results` | integer | no | `3` | Maximum inspections to return, for example 25. Up to 100. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "company"
  ],
  "properties": {
    "state": {
      "type": "string",
      "description": "State name or two-letter code, for example Tennessee or TN.",
      "examples": [
        "TN"
      ]
    },
    "status": {
      "enum": [
        "all",
        "open",
        "closed"
      ],
      "type": "string",
      "default": "all",
      "description": "Case status to include, for example closed.",
      "examples": [
        "closed"
      ]
    },
    "company": {
      "type": "string",
      "description": "Company or establishment name, for example Tyson Foods.",
      "examples": [
        "Tyson Foods",
        "Amazon",
        "CompletelyNonexistentCompanyNameABCXYZ928371"
      ]
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "description": "Earliest inspection date in YYYY-MM-DD, for example 2022-01-01. Defaults to five years ago."
    },
    "max_results": {
      "type": "integer",
      "default": 25,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum inspections to return, for example 25. Up to 100.",
      "x-fous-developer": true,
      "examples": [
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "state": "TN",
      "company": "Tyson Foods",
      "max_results": 3
    },
    {
      "status": "closed",
      "company": "Amazon",
      "max_results": 3
    },
    {
      "company": "CompletelyNonexistentCompanyNameABCXYZ928371"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `inspections` | array |  | Inspections, newest first. |
| `inspections[].city` | string or null | `"Newbern"` | Site city. |
| `inspections[].scope` | string or null | `"Partial"` | Scope of inspection. |
| `inspections[].state` | string or null | `"TN"` | Site state code. |
| `inspections[].street` | string or null | `"2000 Biffle Rd"` | Site street address. |
| `inspections[].industry` | string or null | `"Animal (except Poultry) Slaughtering"` | Industry description. |
| `inspections[].zip_code` | string or null | `"38059"` | Site ZIP code. |
| `inspections[].naics_code` | string or null | `"311611"` | NAICS industry classification code. |
| `inspections[].case_status` | string or null | `"Open"` | Case status. |
| `inspections[].activity_number` | string | `"1898841.015"` | OSHA inspection activity number. |
| `inspections[].inspection_date` | string | `"2026-06-10"` | Date inspection opened, YYYY-MM-DD. |
| `inspections[].inspection_type` | string or null | `"Complaint"` | Reason or type of inspection in words. |
| `inspections[].violations_found` | boolean or null | `true` | Whether posted violations were found. |
| `inspections[].establishment_name` | string or null | `"Tyson Foods Inc"` | Name of the inspected workplace. |
| `inspections[].serious_violations` | integer or null | `1` | Current serious violations. |
| `inspections[].current_penalty_usd` | number or null | `2800` | Current total penalty in USD. |
| `inspections[].initial_penalty_usd` | number or null | `2800` | Initial total penalty in USD. |
| `inspections[].number_of_violations` | integer or null | `1` | Current number of violations. |
| `inspections[].inspection_detail_link` | string | `"https://www.osha.gov/ords/imis/establishment.inspection_detail?id=1898841.015"` | OSHA inspection detail page. |

**Example input**

```json
{
  "state": "TN",
  "company": "Tyson Foods",
  "max_results": 3
}
```

**Example output**

```json
{
  "inspections": [
    {
      "city": "Newbern",
      "scope": "Partial",
      "state": "TN",
      "street": "2000 Biffle Rd",
      "industry": "Animal (except Poultry) Slaughtering",
      "zip_code": "38059",
      "naics_code": "311611",
      "case_status": "Open",
      "activity_number": "1898841.015",
      "inspection_date": "2026-06-10",
      "inspection_type": "Complaint",
      "violations_found": true,
      "establishment_name": "Tyson Foods Inc",
      "serious_violations": 1,
      "current_penalty_usd": 2800,
      "initial_penalty_usd": 2800,
      "number_of_violations": 1,
      "inspection_detail_link": "https://www.osha.gov/ords/imis/establishment.inspection_detail?id=1898841.015"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@osha",
  "visibility": "public",
  "operation": "search_inspections",
  "version": 1,
  "input": {
    "state": "TN",
    "company": "Tyson Foods",
    "max_results": 3
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@osha\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_inspections\",\n  \"version\": 1,\n  \"input\": {\n    \"state\": \"TN\",\n    \"company\": \"Tyson Foods\",\n    \"max_results\": 3\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@osha",
  "visibility": "public",
  "operation": "search_inspections",
  "version": 1,
  "input": {
    "state": "TN",
    "company": "Tyson Foods",
    "max_results": 3
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/osha`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_inspections`: Search inspections. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-osha https://api.fous.com/mcp/tools/osha --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this OSHA tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a OSHA account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from osha.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

## Related

- [Companies House API](https://fous.com/tools/companies-house.md): Companies House returns UK public-register company details, officers, people with significant control and recent filings; records may be incomplete, and ceased entries are optional.
- [FDA API](https://fous.com/tools/fda.md): FDA provides drug safety data, latest matching drug labels, common reported side effects, and newest-first drug, food, and device recalls; recent drug and device recalls may be missing, and weekly food statuses may lag.
- [IRS API](https://fous.com/tools/irs.md): IRS provides tax information and public organization records, including charity status and current-directory forms, instructions, and publications with revision and posting dates.
- [Annuaire des Entreprises API](https://fous.com/tools/annuaire-des-entreprises.md): French government directory of public company registrations.
- [Bureau of Labor Statistics API](https://fous.com/tools/bureau-of-labor-statistics.md): Bureau of Labor Statistics provides latest occupation pay, employment, career outlooks, unemployment, category inflation (up to 24 months’ history), and CPI conversions from January 1913.
- [CPSC API](https://fous.com/tools/cpsc.md): U.S. Consumer Product Safety Commission recalls and product safety information.
- [USAJOBS API](https://fous.com/tools/usajobs.md): Federal government job listings and announcements.
- [SEC EDGAR API](https://fous.com/tools/sec-edgar.md): SEC EDGAR provides filings, annual and quarterly financials, exact-phrase matches, up to 200 insider trades, and quarterly 13F manager holdings; older filings appear when available.
- [All Government tools](https://fous.com/tools/category/government)
