{
  "openapi": "3.0.1",
  "info": {
    "title": "US EPA ECHO Compliance & Enforcement: All States",
    "description": "Search EPA ECHO facilities and enforcement cases in all 50 states, DC, and territories by county, program, violation, penalty, and NAICS industry, or monitor new enforcement on a schedule.",
    "version": "0.1",
    "x-build-id": "BPzEkouetpUg3Qi2K"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maniginam~us-epa-echo-compliance-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maniginam-us-epa-echo-compliance-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/maniginam~us-epa-echo-compliance-monitor/runs": {
      "post": {
        "operationId": "runs-sync-maniginam-us-epa-echo-compliance-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/maniginam~us-epa-echo-compliance-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-maniginam-us-epa-echo-compliance-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": {
          "recordType": {
            "title": "Records to return",
            "enum": [
              "facilities",
              "enforcementCases"
            ],
            "type": "string",
            "description": "Facilities with their compliance, inspection, enforcement, and penalty summary, or individual federal EPA civil enforcement cases.",
            "default": "facilities"
          },
          "states": {
            "title": "States",
            "maxItems": 56,
            "type": "array",
            "description": "States, DC, or territories to search.  Leave empty to search all of them.  There is no row limit, so even every facility in the country can be searched.",
            "items": {
              "type": "string",
              "enum": [
                "AL",
                "AK",
                "AZ",
                "AR",
                "CA",
                "CO",
                "CT",
                "DE",
                "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",
                "DC",
                "PR",
                "VI",
                "GU",
                "AS",
                "MP"
              ],
              "enumTitles": [
                "Alabama",
                "Alaska",
                "Arizona",
                "Arkansas",
                "California",
                "Colorado",
                "Connecticut",
                "Delaware",
                "Florida",
                "Georgia",
                "Hawaii",
                "Idaho",
                "Illinois",
                "Indiana",
                "Iowa",
                "Kansas",
                "Kentucky",
                "Louisiana",
                "Maine",
                "Maryland",
                "Massachusetts",
                "Michigan",
                "Minnesota",
                "Mississippi",
                "Missouri",
                "Montana",
                "Nebraska",
                "Nevada",
                "New Hampshire",
                "New Jersey",
                "New Mexico",
                "New York",
                "North Carolina",
                "North Dakota",
                "Ohio",
                "Oklahoma",
                "Oregon",
                "Pennsylvania",
                "Rhode Island",
                "South Carolina",
                "South Dakota",
                "Tennessee",
                "Texas",
                "Utah",
                "Vermont",
                "Virginia",
                "Washington",
                "West Virginia",
                "Wisconsin",
                "Wyoming",
                "District of Columbia",
                "Puerto Rico",
                "U.S. Virgin Islands",
                "Guam",
                "American Samoa",
                "Northern Mariana Islands"
              ]
            },
            "default": []
          },
          "counties": {
            "title": "Counties or parishes",
            "maxItems": 100,
            "type": "array",
            "description": "County names, such as Harris, Los Angeles, Cook, or East Baton Rouge.  Spelling is forgiving: accents, \"Saint\" or \"St.\", and \"County\", \"Parish\", \"Borough\", or \"Census Area\" are all optional.  Virginia independent cities end in \"city\", like \"Richmond city\".  A name is searched in every selected state that has it.  Facility searches only.  Leave empty to search whole states.",
            "items": {
              "type": "string",
              "maxLength": 60
            },
            "default": []
          },
          "programs": {
            "title": "EPA programs",
            "maxItems": 4,
            "type": "array",
            "description": "Clean Air Act, Clean Water Act, hazardous waste (RCRA), or Safe Drinking Water Act.  For cases this picks the primary law.  Leave empty for every program.",
            "items": {
              "type": "string",
              "enum": [
                "CAA",
                "CWA",
                "RCRA",
                "SDWA"
              ],
              "enumTitles": [
                "Clean Air Act",
                "Clean Water Act",
                "RCRA hazardous waste",
                "Safe Drinking Water Act"
              ]
            },
            "default": []
          },
          "activeOnly": {
            "title": "Active facilities only",
            "type": "boolean",
            "description": "Skip closed and inactive facilities.  Facility searches only.",
            "default": true
          },
          "violationStatus": {
            "title": "Violation status",
            "enum": [
              "any",
              "currentViolation",
              "significantViolation"
            ],
            "type": "string",
            "description": "Only facilities with a current alleged violation, or only those in significant noncompliance.  Facility searches only.",
            "default": "any"
          },
          "formalEnforcementWithinYears": {
            "title": "Formal enforcement within (years)",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only facilities with a formal enforcement action in the last 1 to 5 years.  0 turns this off.  Facility searches only.",
            "default": 0
          },
          "minPenaltyUsd": {
            "title": "Minimum penalties (USD)",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "integer",
            "description": "Facilities: total penalties in the last five years at or above this amount.  Cases: federal plus state penalty at or above it.  0 turns this off.",
            "default": 0
          },
          "naicsCodes": {
            "title": "NAICS industry codes",
            "maxItems": 20,
            "type": "array",
            "description": "NAICS codes or prefixes of 2 to 6 digits, for example 325 (chemicals) or 324110 (refineries).  Cases match on their primary NAICS code.",
            "items": {
              "type": "string",
              "pattern": "^\\s*\\d{2,6}\\s*$"
            },
            "default": []
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Cases: filed, lodged, settled, or closed on or after this day.  Facilities: last formal action on or after this day.  YYYY-MM-DD."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Cases: filed, lodged, settled, or closed on or before this day.  Facilities: last formal action on or before this day.  YYYY-MM-DD."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 250000,
            "type": "integer",
            "description": "The most records to publish and charge in this run.",
            "default": 1000
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed (monitor mode)",
            "type": "boolean",
            "description": "Remember what this exact search returned before and publish only records that are new or whose enforcement history changed.  Use it on a schedule.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}