{
  "openapi": "3.0.1",
  "info": {
    "title": "Gulf Coast EPA Compliance & Enforcement Monitor (ECHO)",
    "description": "Search EPA ECHO facilities and enforcement cases in Louisiana, Texas, Mississippi, Alabama, and Florida by parish or county, program, violation, penalty, and industry, or monitor new enforcement on a schedule.",
    "version": "0.1",
    "x-build-id": "0aarKac0nD00BC4Pz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maniginam~gulf-coast-epa-compliance-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maniginam-gulf-coast-epa-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~gulf-coast-epa-compliance-monitor/runs": {
      "post": {
        "operationId": "runs-sync-maniginam-gulf-coast-epa-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~gulf-coast-epa-compliance-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-maniginam-gulf-coast-epa-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 and state enforcement cases.",
            "default": "facilities"
          },
          "states": {
            "title": "States",
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "description": "Gulf Coast states to search.  Louisiana is the default.",
            "items": {
              "type": "string",
              "enum": [
                "LA",
                "TX",
                "MS",
                "AL",
                "FL"
              ],
              "enumTitles": [
                "Louisiana",
                "Texas",
                "Mississippi",
                "Alabama",
                "Florida"
              ]
            },
            "default": [
              "LA"
            ]
          },
          "counties": {
            "title": "Counties or parishes",
            "maxItems": 100,
            "type": "array",
            "description": "County or parish names, such as East Baton Rouge, St. James, or Harris.  Spelling is forgiving: \"Saint\" or \"St.\", with or without \"Parish\" or \"County\".  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).",
            "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: enforcement activity on or after this day, as ECHO defines it.  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: enforcement activity on or before this day, as ECHO defines it.  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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}