{
  "openapi": "3.0.1",
  "info": {
    "title": "OSHA Inspections, Violations & Fatal Accident Scraper",
    "description": "Scrape US OSHA workplace safety enforcement: inspections with employer site and mailing address, NAICS, citations by standard with penalties, abatement and contest status, plus fatal and catastrophic accident investigations with narrative and victim details. JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "ntle7sJs3GVnGKWPU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~osha-inspections-violations-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-osha-inspections-violations-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/scrapers_lat~osha-inspections-violations-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-osha-inspections-violations-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/scrapers_lat~osha-inspections-violations-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-osha-inspections-violations-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": {
          "searchType": {
            "title": "What To Search",
            "enum": [
              "inspections",
              "accidents"
            ],
            "type": "string",
            "description": "Inspections = search OSHA's establishment record by employer name, site ZIP code or state. Accident investigations = start from the fatality and catastrophe reports (searchable by industry code and keyword nationwide) and return the inspection behind each one, with the narrative and victim details attached.",
            "default": "inspections"
          },
          "establishmentNames": {
            "title": "Employer / Establishment Names",
            "type": "array",
            "description": "Employer or site names to search, one search per item (for example 'Amazon', 'roofing', 'Tyson Foods'). OSHA matches whole words, so 'roofing' finds every establishment with 'Roofing' in its name. Combine with states to narrow the search.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "US States",
            "type": "array",
            "description": "Two-letter state codes (for example 'TX', 'CA', 'NV'). With an employer name or ZIP code these narrow the search. On their own they sweep every OSHA area and state-plan office covering that state — the way to pull a whole state's enforcement history.",
            "items": {
              "type": "string"
            }
          },
          "siteZipCodes": {
            "title": "Site ZIP Codes",
            "type": "array",
            "description": "Five-digit ZIP codes of the inspected worksite (for example '89109'). Returns every inspection at that location regardless of employer — the fastest way to cover a metro area or a single industrial park.",
            "items": {
              "type": "string"
            }
          },
          "inspectionNumbers": {
            "title": "Inspection Numbers",
            "type": "array",
            "description": "Optional. Look up exact OSHA inspection numbers directly (for example '1794125.015'). The '.015' suffix is added automatically. When given, these are fetched instead of running searches.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Inspection Opened From",
            "type": "string",
            "description": "Only inspections opened on or after this date (YYYY-MM-DD). Leave empty for the full archive."
          },
          "dateTo": {
            "title": "Inspection Opened To",
            "type": "string",
            "description": "Only inspections opened on or before this date (YYYY-MM-DD). Leave empty for the full archive."
          },
          "withViolations": {
            "title": "Violations",
            "enum": [
              "all",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Restrict to inspections that did or did not result in citations.",
            "default": "all"
          },
          "caseStatus": {
            "title": "Case Status",
            "enum": [
              "all",
              "open",
              "closed"
            ],
            "type": "string",
            "description": "Open cases are still in the citation, contest or abatement stage; closed cases are fully resolved.",
            "default": "all"
          },
          "officeType": {
            "title": "Enforcement Program",
            "enum": [
              "all",
              "fed",
              "state"
            ],
            "type": "string",
            "description": "Federal OSHA, the state-run OSHA plans, or both.",
            "default": "all"
          },
          "naicsCodes": {
            "title": "NAICS Codes (accident search)",
            "type": "array",
            "description": "Accident-investigation searches only. Industry codes to search nationwide, for example '238160' (roofing) or '2382' (building equipment contractors). This is how you pull every fatal accident in an industry.",
            "items": {
              "type": "string"
            }
          },
          "sicCodes": {
            "title": "SIC Codes (accident search)",
            "type": "array",
            "description": "Accident-investigation searches only. Four-digit SIC industry codes, used when no NAICS code is given.",
            "items": {
              "type": "string"
            }
          },
          "accidentKeyword": {
            "title": "Accident Keyword",
            "type": "string",
            "description": "Accident-investigation searches only. OSHA's own hazard keyword, for example 'Fall Protection', 'Trench', 'Amputation', 'Heat', 'Forklift'."
          },
          "accidentDescription": {
            "title": "Accident Description Contains",
            "type": "string",
            "description": "Accident-investigation searches only. Words from the one-line event description, for example 'crushed' or 'electrocuted'."
          },
          "accidentAbstract": {
            "title": "Accident Narrative Contains",
            "type": "string",
            "description": "Accident-investigation searches only. Words from the full investigator narrative."
          },
          "fatalAccidentsOnly": {
            "title": "Fatal Accidents Only",
            "type": "boolean",
            "description": "Accident-investigation searches only. Return only investigations where a worker was killed.",
            "default": false
          },
          "minCurrentPenaltyUsd": {
            "title": "Minimum Current Penalty (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only inspections whose current penalty is at least this amount. Use it to isolate the serious enforcement cases."
          },
          "minViolations": {
            "title": "Minimum Violations",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only inspections with at least this many current violations."
          },
          "citationTypes": {
            "title": "Citation Types",
            "type": "array",
            "description": "Keep only inspections carrying at least one citation of these types. Willful and repeat citations are the strongest risk signals. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "serious",
                "willful",
                "repeat",
                "other"
              ]
            }
          },
          "inspectionTypes": {
            "title": "Inspection Types",
            "type": "array",
            "description": "Keep only these kinds of inspection, matched on the type text (for example 'Complaint', 'Accident', 'Referral', 'Planned', 'Fat/Cat', 'FollowUp'). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "naicsPrefixes": {
            "title": "NAICS Prefixes",
            "type": "array",
            "description": "Keep only inspections whose establishment NAICS code starts with one of these (for example '23' for construction, '311' for food manufacturing, '62' for health care).",
            "items": {
              "type": "string"
            }
          },
          "onlyFatalities": {
            "title": "Only Fatality / Catastrophe Cases",
            "type": "boolean",
            "description": "Keep only inspections tied to a worker death or a catastrophe investigation.",
            "default": false
          },
          "requireSiteAddress": {
            "title": "Only With A Street Address",
            "type": "boolean",
            "description": "Keep only inspections that have a full street address for the worksite.",
            "default": false
          },
          "fetchCitationDetails": {
            "title": "Fetch Citation Details",
            "type": "boolean",
            "description": "For every citation, also fetch the plain-English title of the standard cited, the number of workers exposed, the number of instances, the gravity score, the abatement status and the final order date. Turn off for a faster, lighter run.",
            "default": true
          },
          "includeAccidentInvestigations": {
            "title": "Include Accident Investigations",
            "type": "boolean",
            "description": "Attach OSHA's accident investigation summaries to each inspection: the investigator narrative, hazard keywords, project type and the victim's age, occupation, degree and nature of injury. Always on when searching accident investigations.",
            "default": false
          },
          "maxRecords": {
            "title": "Max Inspections To Scrape",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of inspection records to return across all searches."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. OSHA is reachable without a proxy; enable one only if your network needs it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}