{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA Enforcement Monitor: Environmental Cases & Penalties (MCP)",
    "description": "Official EPA ECHO feed: civil & criminal environmental cases with federal penalties, SEP projects, cost recovery, statutes and outcomes. Server-side state/law/penalty/date filters. Monitor mode = new case & changed-settlement alerts, daily. No API key. MCP-ready.",
    "version": "0.0",
    "x-build-id": "G0wBYLVQ5KmZOdcP4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/amygraphics~epa-enforcement-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-amygraphics-epa-enforcement-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/amygraphics~epa-enforcement-monitor/runs": {
      "post": {
        "operationId": "runs-sync-amygraphics-epa-enforcement-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/amygraphics~epa-enforcement-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-amygraphics-epa-enforcement-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "search = window of cases. monitor = only cases never returned before (KV dedupe on case+settlement+penalty) — schedule daily.",
            "default": "search"
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "US state postal codes, server-side: TX, CA, FL… — empty = ALL states (use with penalty filters & small windows).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Window in days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Milestone-activity window ending today (server-side). Ignored if fromDate is set.",
            "default": 30
          },
          "fromDate": {
            "title": "From date (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional explicit window start, overrides daysBack.",
            "default": ""
          },
          "toDate": {
            "title": "To date (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional explicit window end (default: today).",
            "default": ""
          },
          "caseCategories": {
            "title": "Case categories",
            "type": "array",
            "description": "AFR (Administrative Formal), AIF (Administrative Informal), JDC (Judicial) — empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "civilCriminal": {
            "title": "Civil / Criminal",
            "enum": [
              "",
              "CI",
              "CR"
            ],
            "type": "string",
            "description": "CI = civil only · CR = concluded criminal prosecutions · empty = both.",
            "default": ""
          },
          "caseLead": {
            "title": "Case lead",
            "enum": [
              "",
              "E",
              "S"
            ],
            "type": "string",
            "description": "E = EPA-led cases only · S = state-led only · empty = both.",
            "default": ""
          },
          "law": {
            "title": "Statute (server-side)",
            "enum": [
              "",
              "CAA",
              "CWA",
              "RCRA",
              "SDWA",
              "CERCLA",
              "EPCRA",
              "FIFRA",
              "TSCA"
            ],
            "type": "string",
            "description": "One statute code: CAA / CWA / RCRA / SDWA / CERCLA / EPCRA / FIFRA / TSCA — empty = all.",
            "default": ""
          },
          "minFedPenalty": {
            "title": "Minimum federal penalty ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Server-side threshold: cases with total federal penalty above this. 0 = off. ⚠️ Filters OUT 'no penalty' orders.",
            "default": 0
          },
          "naics": {
            "title": "Industry NAICS code",
            "type": "string",
            "description": "2–6 digits (e.g. 221 = utilities, 324 = petroleum refining) server-side.",
            "default": ""
          },
          "voluntaryDisclosure": {
            "title": "Voluntary disclosure",
            "enum": [
              "",
              "Y",
              "N"
            ],
            "type": "string",
            "description": "Y = only self-disclosed cases · N = exclude them · empty = all.",
            "default": ""
          },
          "lawIncludes": {
            "title": "Law contains (client-side)",
            "type": "string",
            "description": "Match against law flags and primary law (multi-statute cases where another law was also cited).",
            "default": ""
          },
          "outcomeIncludes": {
            "title": "Outcome contains",
            "type": "string",
            "description": "e.g. 'with penalty', 'no penalty', 'administrative order'.",
            "default": ""
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Match against case name, pollutant description, outcome, law (e.g. 'refinery', 'benzene', 'asbestos').",
            "default": ""
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Stop after this many cases.",
            "default": 100
          },
          "requestDelaySecs": {
            "title": "Delay between requests (s)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Politeness pacing toward the official EPA portal.",
            "default": 0.4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (optional)",
            "type": "object",
            "description": "NOT needed — official API.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}