{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA Drinking Water Quality Screener - Violations, Lead & PFAS",
    "description": "Screen any US coordinate for the public water system serving it: SDWA health-based violations, Lead & Copper Rule 90th-percentile results and UCMR5 PFAS detections. Built for Phase I ESA and real-estate due diligence. Never reports a clear result from a source that did not answer.",
    "version": "1.0",
    "x-build-id": "4b166zmbZpPMX0I4E"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~epa-drinking-water-quality-screener/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-epa-drinking-water-quality-screener",
        "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/malonestar~epa-drinking-water-quality-screener/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-epa-drinking-water-quality-screener",
        "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/malonestar~epa-drinking-water-quality-screener/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-epa-drinking-water-quality-screener",
        "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": {
          "assets": {
            "title": "Locations to screen",
            "type": "array",
            "description": "Sites to screen, each {\"lat\": <number>, \"lon\": <number>, \"label\": \"<your name for the site>\"}. Each location is matched against EPA's mapped community water system service areas to identify the serving public water system. A location with no mapped service area returns an explicit NO_SERVICE_AREA row (likely a private well), never a false clear."
          },
          "pwsids": {
            "title": "PWSIDs to screen directly",
            "type": "array",
            "description": "Optional. Screen specific public water systems by 9-character EPA PWSID (for example [\"MI0002310\"]) without a coordinate lookup. Combined with any locations supplied above.",
            "items": {
              "type": "string"
            }
          },
          "includeViolations": {
            "title": "Include SDWA violations",
            "type": "boolean",
            "description": "Fetch the system's full Safe Drinking Water Act violation history from EPA SDWIS and roll it up (health-based, monitoring/reporting, treatment technique, Lead & Copper Rule, public-notification tier)."
          },
          "includeLead": {
            "title": "Include lead and copper results",
            "type": "boolean",
            "description": "Fetch Lead and Copper Rule 90th-percentile tap results and join them to their monitoring periods, so the reported value is dated rather than undated."
          },
          "includePfas": {
            "title": "Include UCMR5 PFAS results",
            "type": "boolean",
            "description": "Screen the system against EPA's UCMR5 occurrence dataset (1.9 million results, 29 PFAS analytes plus lithium). Turn off for a faster run when PFAS is out of scope."
          },
          "includeEnforcement": {
            "title": "Include formal enforcement actions",
            "type": "boolean",
            "description": "Fetch the system's SDWIS formal enforcement action history and report the count and most recent action."
          },
          "violationYears": {
            "title": "Recent-violation window (years)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "How many years back counts as a recent health-based violation for the screening flags. The full violation history is still summarised regardless. Set 0 to disable the window."
          },
          "maxViolationDetails": {
            "title": "Max health-based violation detail records per system",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many individual health-based violation records to include in the health_based_violation_details array on each row, newest first. Counts are never truncated."
          },
          "maxAssets": {
            "title": "Max locations to screen",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap on how many locations are screened in one run. Locations beyond the cap are reported in the log and not billed."
          },
          "runBudgetSeconds": {
            "title": "Run wall-clock budget (seconds)",
            "minimum": 60,
            "maximum": 7200,
            "type": "integer",
            "description": "Total time budget for all upstream requests including retries. Requests stop rather than retry past this budget, so a long EPA outage fails loudly instead of hanging."
          },
          "refreshPfasCache": {
            "title": "Force a UCMR5 cache rebuild",
            "type": "boolean",
            "description": "Re-download and re-index the UCMR5 occurrence file even if the cached index already matches EPA's current published vintage. Normally unnecessary: the cache is keyed to the file's Last-Modified header and rebuilds itself whenever EPA republishes."
          },
          "simulateOutage": {
            "title": "Simulate an upstream outage (diagnostics)",
            "enum": [
              "none",
              "boundary",
              "system",
              "violations",
              "lead",
              "pfas",
              "all"
            ],
            "type": "string",
            "description": "Diagnostic seam for verifying failure behaviour. Forces one or all EPA sources to fail so you can confirm the actor reports the source as unavailable and never publishes a false clear. Leave as none for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}