{
  "openapi": "3.0.1",
  "info": {
    "title": "OSHA Inspections & Citations Feed - Workplace Safety Penalties",
    "description": "Feed of new OSHA workplace-safety inspections and citations from official US Dept. of Labor data: company, site address, industry (NAICS), inspection type (fatality, complaint...), violations, standards cited, penalties. Filter by state, industry, penalty. New-since-last-run alerts.",
    "version": "0.1",
    "x-build-id": "lRfQcp2mFCfVOvfFU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moment-data~osha-inspections-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moment-data-osha-inspections-feed",
        "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/moment-data~osha-inspections-feed/runs": {
      "post": {
        "operationId": "runs-sync-moment-data-osha-inspections-feed",
        "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/moment-data~osha-inspections-feed/run-sync": {
      "post": {
        "operationId": "run-sync-moment-data-osha-inspections-feed",
        "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": {
          "events": {
            "title": "Events",
            "type": "array",
            "description": "cited = inspections whose citations (violations + penalties) were issued in the window. opened = inspections opened in the window (early signal; citations usually follow months later). With both, up to half of maxItems go to citations.",
            "items": {
              "type": "string",
              "enum": [
                "cited",
                "opened"
              ],
              "enumTitles": [
                "Cited (violations and penalties issued)",
                "Opened (new inspections)"
              ]
            },
            "default": [
              "cited",
              "opened"
            ]
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Optional. Two-letter codes of the inspected site, e.g. TX, CA, CO, PR. Empty = all states and territories.",
            "items": {
              "type": "string"
            }
          },
          "naicsPrefixes": {
            "title": "Industries (NAICS prefixes)",
            "type": "array",
            "description": "Optional. NAICS code prefixes, e.g. 23 (construction), 238 (specialty trade contractors), 311 (food manufacturing), 493 (warehousing), 622 (hospitals). Empty = all industries.",
            "items": {
              "type": "string"
            }
          },
          "inspectionTypes": {
            "title": "Inspection types",
            "type": "array",
            "description": "Optional. Why OSHA inspected. Empty = all types.",
            "items": {
              "type": "string",
              "enum": [
                "fatality-catastrophe",
                "accident",
                "complaint",
                "referral",
                "planned",
                "follow-up",
                "programmed-related",
                "unprogrammed-related",
                "monitoring",
                "variance",
                "programmed-other",
                "unprogrammed-other",
                "other"
              ],
              "enumTitles": [
                "Fatality / catastrophe",
                "Accident",
                "Complaint",
                "Referral",
                "Planned (programmed)",
                "Follow-up",
                "Programmed related",
                "Unprogrammed related",
                "Monitoring",
                "Variance",
                "Programmed other",
                "Unprogrammed other",
                "Other"
              ]
            }
          },
          "companyKeyword": {
            "title": "Establishment name contains",
            "type": "string",
            "description": "Optional. Text match on the inspected establishment (employer) name, e.g. 'Amazon', 'Tyson', 'Construction'."
          },
          "minPenalty": {
            "title": "Minimum penalty (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only cited inspections whose total current or initial penalty is at least this amount, e.g. 50000. Implies the 'cited' event."
          },
          "seriousOrWillfulOnly": {
            "title": "Serious, willful or repeat only",
            "type": "boolean",
            "description": "Only cited inspections with at least one serious, willful or repeat violation. Implies the 'cited' event.",
            "default": false
          },
          "daysBack": {
            "title": "Events within (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Citations issued / inspections opened in the last N days. DOL's public citation table lags several weeks behind the inspection table, so keep this at 60 or more if you want citations.",
            "default": 60
          },
          "maxItems": {
            "title": "Max inspections per run",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on delivered records (also caps your spend). Newest first; bigger penalties first on the same day.",
            "default": 40
          },
          "includeCitations": {
            "title": "Include citation lines",
            "type": "boolean",
            "description": "Add the individual citation items (standard, plain-English topic, type, penalty, abatement date) to each cited inspection, up to 25 per inspection.",
            "default": true
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "window",
              "sinceLastRun"
            ],
            "type": "string",
            "description": "window (default): everything in the time window, no saved state. sinceLastRun: only events not delivered before for this State key (an inspection is delivered once when opened and again when cited). Use for schedules and alerts.",
            "default": "window"
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the saved feed for sinceLastRun mode. Use one key per schedule.",
            "default": "default"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}