{
  "openapi": "3.0.1",
  "info": {
    "title": "OSHA & EPA Violation Monitor: Fines by Company",
    "description": "Find US OSHA and EPA enforcement cases by company, state, industry and date: penalties, citations, violation type and a link to the official record. EPA works with no key; OSHA uses the free Department of Labor API key. No proxy or login.",
    "version": "1.0",
    "x-build-id": "hhcQaTks7q9d2thhV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/offerastudio~osha-epa-violation-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-offerastudio-osha-epa-violation-monitor",
        "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/offerastudio~osha-epa-violation-monitor/runs": {
      "post": {
        "operationId": "runs-sync-offerastudio-osha-epa-violation-monitor",
        "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/offerastudio~osha-epa-violation-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-offerastudio-osha-epa-violation-monitor",
        "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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "OSHA: workplace-safety inspections with citations (needs a free DOL API key). EPA: environmental enforcement cases from EPA ECHO (no key). Leave both for the full picture.",
            "items": {
              "type": "string",
              "enum": [
                "osha",
                "epa"
              ],
              "enumTitles": [
                "OSHA (workplace safety)",
                "EPA (environment)"
              ]
            },
            "default": [
              "osha",
              "epa"
            ]
          },
          "companyNames": {
            "title": "Company names",
            "type": "array",
            "description": "Optional. Companies or facilities to find, for example Cargill or \"Tyson Foods\". Matching is fuzzy: legal suffixes such as Inc or LLC are ignored and small typos are tolerated. EPA matches on the case name. Leave empty to list every case that fits the other filters.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter US state codes, for example TX or CA. Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "maxItems": 5,
            "type": "array",
            "description": "Industry codes or prefixes of 2 to 6 digits, for example 311 (food manufacturing) or 2381. Up to 5. A case matching any of them is included.",
            "items": {
              "type": "string"
            }
          },
          "sicCodes": {
            "title": "SIC codes",
            "maxItems": 5,
            "type": "array",
            "description": "4-digit SIC codes, for example 2011. Up to 5.",
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 1825,
            "type": "integer",
            "description": "Cases with activity in the last N days. OSHA: citations issued. EPA: filed, settled or closed. Ignored when \"Date from\" is set.",
            "default": 90
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional start of the period (YYYY-MM-DD). Overrides \"Days back\"."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional end of the period (YYYY-MM-DD). Default: today."
          },
          "minPenalty": {
            "title": "Minimum penalty (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only cases with a current penalty of at least this amount. OSHA: the sum of the inspection's citations.",
            "default": 0
          },
          "maxResults": {
            "title": "Maximum cases",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit of cases returned, and so of the cost: at most this many cases are billed.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "date",
              "penalty"
            ],
            "type": "string",
            "description": "Which cases are kept when there are more than the maximum.",
            "default": "date"
          },
          "epaFacilityDetails": {
            "title": "Add EPA facility address",
            "type": "boolean",
            "description": "Looks up the registered facility (name, address, NAICS) of each EPA case. Costs two extra requests per case, for the first 60 cases. Turn off for a faster run.",
            "default": true
          },
          "dolApiKey": {
            "title": "DOL API key (OSHA)",
            "type": "string",
            "description": "Optional. Free key from dataportal.dol.gov. If left empty the Actor uses its own key, when it has one. Without any key only EPA cases are returned."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}