{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA ECHO Enforcement & Compliance Scraper",
    "description": "Scrape EPA ECHO enforcement case data and facility compliance status. Search cases by state, statute (Clean Air Act, Clean Water Act, RCRA, etc.), civil/criminal type, and date filed. Search facilities by name, ZIP, or state for inspections, violations, and penalties. No API key required.",
    "version": "1.0",
    "x-build-id": "4BC2aflzdMBwT3j8N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~epa-echo-enforcement-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-epa-echo-enforcement-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/crawlerbros~epa-echo-enforcement-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-epa-echo-enforcement-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/crawlerbros~epa-echo-enforcement-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-epa-echo-enforcement-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Search Mode",
            "enum": [
              "searchCases",
              "searchFacilities",
              "byRegistryIds"
            ],
            "type": "string",
            "description": "searchCases: EPA/state enforcement cases (civil & criminal, penalties, statutes). searchFacilities: facility-level compliance status, inspections, and violations. byRegistryIds: exact lookup of known facilities by EPA FRS Registry ID.",
            "default": "searchCases"
          },
          "state": {
            "title": "State / Territory (mode=searchCases, searchFacilities)",
            "enum": [
              "",
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "DC",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MA",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY",
              "AS",
              "GU",
              "MP",
              "PR",
              "VI"
            ],
            "type": "string",
            "description": "US state or territory. Optional for searchFacilities (narrows a nationwide search — still requires facilityName/zipCode/sicCode/majorFacilitiesOnly to keep result sets manageable). For searchCases, either this or `epaRegion` is required (EPA's API requires a state, region, or similarly narrow filter to keep result sets under its size limit). Not used by byRegistryIds.",
            "default": "CA"
          },
          "registryIds": {
            "title": "Registry IDs (mode=byRegistryIds)",
            "type": "array",
            "description": "One or more EPA FRS Registry IDs (e.g. from a prior searchFacilities run's `registryId` field) to fetch directly.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "epaRegion": {
            "title": "EPA Region (mode=searchCases)",
            "enum": [
              "",
              "01",
              "02",
              "03",
              "04",
              "05",
              "06",
              "07",
              "08",
              "09",
              "10"
            ],
            "type": "string",
            "description": "Filter to one EPA administrative region instead of (or in addition to) a single state. Either `state` or `epaRegion` is required for searchCases.",
            "default": ""
          },
          "naicsCode": {
            "title": "NAICS Code (mode=searchCases)",
            "type": "string",
            "description": "Filter enforcement cases to a NAICS industry code. Accepts a full 6-digit code (e.g. '311512' for creamery butter manufacturing) or a shorter prefix to match a whole industry sector (e.g. '31' for all manufacturing).",
            "default": ""
          },
          "sicCode": {
            "title": "SIC Code (mode=searchCases, searchFacilities)",
            "type": "string",
            "description": "Filter to a Standard Industrial Classification code. Accepts a full 4-digit code (e.g. '2011' for meat packing plants) or a shorter prefix to match a broader industry group (e.g. '20' for food & kindred products).",
            "default": ""
          },
          "lawCited": {
            "title": "Law Cited / Statute (mode=searchCases)",
            "enum": [
              "",
              "CAA",
              "CWA",
              "RCRA",
              "SDWA",
              "EPCRA",
              "CERCLA",
              "FIFRA",
              "TSCA"
            ],
            "type": "string",
            "description": "Restrict enforcement cases to a specific environmental statute.",
            "default": ""
          },
          "caseCategory": {
            "title": "Case Category (mode=searchCases)",
            "enum": [
              "",
              "JDC",
              "AFR"
            ],
            "type": "string",
            "description": "Judicial (filed in court) or Administrative (EPA-issued order) enforcement action.",
            "default": ""
          },
          "civilCriminalIndicator": {
            "title": "Civil or Criminal (mode=searchCases)",
            "enum": [
              "",
              "CI",
              "CR"
            ],
            "type": "string",
            "description": "Restrict to civil or criminal enforcement cases.",
            "default": ""
          },
          "caseStatus": {
            "title": "Case Status (mode=searchCases)",
            "enum": [
              "",
              "AOI",
              "CFL",
              "CLS",
              "CNC",
              "CSU",
              "DSP",
              "FOE",
              "FOI",
              "LJD",
              "SPR"
            ],
            "type": "string",
            "description": "Restrict to a specific enforcement case milestone/status.",
            "default": ""
          },
          "dateFiledFrom": {
            "title": "Date Filed From (mode=searchCases)",
            "type": "string",
            "description": "Earliest case-filed date, format MM/DD/YYYY (e.g. 01/01/2020).",
            "default": ""
          },
          "dateFiledTo": {
            "title": "Date Filed To (mode=searchCases)",
            "type": "string",
            "description": "Latest case-filed date, format MM/DD/YYYY (e.g. 12/31/2023).",
            "default": ""
          },
          "federalFacilityOnly": {
            "title": "Federal Facilities Only (mode=searchCases)",
            "type": "boolean",
            "description": "Only return cases involving a federally owned/operated facility.",
            "default": false
          },
          "crossMediaOnly": {
            "title": "Cross-Media Cases Only (mode=searchCases)",
            "type": "boolean",
            "description": "Only return cases spanning multiple environmental programs (air, water, waste, etc.).",
            "default": false
          },
          "tribalLandOnly": {
            "title": "Tribal Land Cases Only (mode=searchCases)",
            "type": "boolean",
            "description": "Only return cases involving facilities on tribal land.",
            "default": false
          },
          "facilityName": {
            "title": "Facility / Company Name (mode=searchFacilities)",
            "type": "string",
            "description": "Partial facility or company name to search for (e.g. 'chevron'). Recommended alongside state to keep results manageable.",
            "default": ""
          },
          "zipCode": {
            "title": "ZIP Code (mode=searchFacilities)",
            "type": "string",
            "description": "5-digit US ZIP code to search within.",
            "default": ""
          },
          "majorFacilitiesOnly": {
            "title": "Major Facilities Only (mode=searchFacilities)",
            "type": "boolean",
            "description": "Only return EPA-designated 'major' facilities (larger regulated sources). Can be used alone with state (no name/ZIP needed) since it is a narrow enough filter.",
            "default": false
          },
          "activeOnly": {
            "title": "Active Facilities Only (mode=searchFacilities)",
            "type": "boolean",
            "description": "Only return facilities currently marked active by EPA.",
            "default": false
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of records to return.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}