# CWA 303(d) Impaired Waters Proximity Screener — NPDES/Phase-I (`malonestar/epa-impaired-waters-303d-screener`) Actor

CWA Section 303(d) impaired-waters proximity API — screens coordinates against EPA ATTAINS impaired/threatened waters: nearest impaired stream or lake, distance, pollutant causes, TMDL status, and an NPDES/stormwater permitting flag for Phase-I ESA site due diligence.

- **URL**: https://apify.com/malonestar/epa-impaired-waters-303d-screener.md
- **Developed by:** [Kyle Maloney](https://apify.com/malonestar) (community)
- **Categories:** Real estate, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## EPA Impaired Waters (CWA 303d) Proximity Screener API

Screen any set of coordinates against the EPA's authoritative **Clean Water Act Section
303(d)** impaired/threatened-waters list (ATTAINS) — the same list every NPDES discharge
permit, stormwater application, and Phase-I water-resources review has to check. For each
site you get: is it in or near an impaired stream, lake, or estuary; how far; what
pollutants caused the impairment; whether a TMDL (cleanup plan) exists; and a one-line
Phase-I-style recommendation.

### Who this is for
- **Environmental consultants** running Phase-I/Phase-II ESAs who need the CWA
  §303(d) water-resources line item without manually querying EPA's ATTAINS map for every
  parcel.
- **NPDES / stormwater permit applicants** (industrial, construction, MS4) who need to know
  up front whether their discharge point is near a water that will trigger antidegradation
  review or tighter effluent limits.
- **Energy and industrial site-selection teams** (solar, wind, data centers, manufacturing)
  screening candidate sites for hidden permitting cost/schedule risk before committing to a
  location.
- **Land developers, CRE lenders, and title/due-diligence teams** who want a fast,
  repeatable water-quality-risk check across a portfolio of parcels.
- **AI agents** (Claude, Cursor, and other MCP clients) doing automated site due diligence —
  clean, typed JSON output with field-level descriptions makes this a reliable chainable
  tool alongside our other federal-overlay screeners (wetlands, critical habitat, flood
  risk, karst, sole-source aquifers).

### What it does
For every coordinate you provide, the actor queries the EPA/Esri Living Atlas **ATTAINS**
FeatureServer — the authoritative mirror of EPA's impaired/threatened-waters and TMDL data
— across all three of its geometry layers (assessed points, streams/rivers, and
lakes/reservoirs/estuaries) within your search radius, then:

- Flags whether the site sits **inside** a mapped impaired-water polygon, or is simply
  **near** one.
- Reports the **nearest** impaired/threatened water's name, type, distance, and CWA
  §303(d) listing status.
- Returns a **de-duplicated list of confirmed impairment causes** (e.g. Pathogens,
  Nutrients, Mercury, PFAS, Sediment) across every match found within the radius.
- Derives a plain-language **TMDL status** (TMDL Established / On 303(d) List — TMDL
  Pending / Alternative Plan in Place / Not Assessed).
- Sets an editorial **NPDES/stormwater permitting flag** and a one-line **Phase-I
  recommendation** you can drop straight into a report.

### Example input
```json
{
  "assets": [
    { "lat": 39.1463728, "lon": -77.0356535, "label": "Proposed outfall — NW Branch Anacostia, MD" },
    { "lat": 39.5296, "lon": -117.0372, "label": "Rural Nevada parcel" }
  ],
  "radiusMiles": 1,
  "maxAssets": 200
}
````

`assets[]` is the only required input — each item needs `lat`/`lon` (WGS84 decimal
degrees) and an optional `label`. `radiusMiles` defaults to 1 (a typical Phase-I /
NPDES-permitting screening distance) and is clamped to 0.1–25 miles.

### Output fields (one row per asset)

| Field | Description |
|---|---|
| `asset_label`, `asset_lat`, `asset_lon` | Echoes the screened coordinate. |
| `in_impaired_water` | True if the coordinate falls inside a mapped impaired-water polygon (lake/reservoir/estuary). |
| `near_impaired_water` | True if any impaired/threatened water was found within `radius_miles`. |
| `impaired_waters_within_radius` | Count of distinct matched assessment units. |
| `nearest_waterbody_name`, `nearest_geometry_type`, `nearest_state` | Identity of the nearest match. |
| `nearest_distance_miles`, `nearest_distance_km` | Straight-line proximity to the nearest match (0 = inside/on it). |
| `nearest_on_303d_list`, `nearest_tmdl_status`, `nearest_overall_status` | CWA §303(d) listing and cleanup-plan status. |
| `impairment_causes` | De-duplicated confirmed pollutant causes across all matches within radius. |
| `npdes_stormwater_flag` | Editorial screening flag for discharge/stormwater permit difficulty. |
| `phase1_recommendation` | One-line, editorial Phase-I-style summary and next step. |
| `nearest_waterbody_report_link` | Link to EPA's How's My Waterway detail report. |
| `error` | Populated only if this specific asset could not be screened; other assets in the same run are unaffected. |

### Use as an MCP tool

This actor is Pay-Per-Event priced and discoverable via `mcp.apify.com` — point an
MCP-compatible agent (Claude, Cursor, etc.) at it and call it directly as a due-diligence
tool, chaining it with the portfolio's other proximity screeners (wetlands, critical
habitat, karst, floodplain, sole-source aquifers) for a full site-constraints sweep from a
single coordinate.

### FAQ

**Is this the official EPA data?** Yes — it queries the Esri Living Atlas mirror of EPA's
ATTAINS Clean Water Act Section 303(d) impaired-waters and TMDL dataset, refreshed roughly
quarterly.

**Does "near" mean the site actually drains to that water?** No. `nearest_distance_miles`
is a straight-line proximity proxy, not a hydrologic drainage delineation. Confirm actual
receiving-water drainage with a site-specific study before any permitting decision — see
the `disclaimer` field on every row.

**What counts as an "impairment cause"?** Only pollutants EPA ATTAINS classifies as a
confirmed `"Cause"` for that water (as opposed to "Insufficient Information" or "Observed
Effect", which are excluded from the causes list but visible if you inspect the raw
service).

**How many sites can I screen at once?** Up to `maxAssets` (default 200, max 2000) per run;
each asset is billed as one Result event.

**What if the EPA service is temporarily renamed or down?** The actor resolves the current
service URL from a stable ArcGIS item id at runtime, so routine quarterly renames need no
code change. If EPA/Esri's service is genuinely unavailable, affected assets return a clear
`error` row instead of failing the whole run.

# Actor input Schema

## `assets` (type: `array`):

Site coordinates to screen against EPA CWA Section 303(d) impaired/threatened waters. Each item: { lat, lon, label? }. lat/lon are decimal degrees (WGS84); label is an optional free-text identifier echoed back on the output row (defaults to asset\_1, asset\_2, ...). One billable result row is returned per asset, even when the site is clear.

## `radiusMiles` (type: `number`):

How far from each asset coordinate to search for CWA Section 303(d) impaired or threatened waterbodies, streams, and lakes. Minimum 0.1, maximum 25. Default 1 mile — a typical Phase-I / NPDES-permitting screening distance.

## `maxAssets` (type: `integer`):

Safety cap on how many assets from the assets array will be screened in a single run (extra assets are skipped with a warning, not an error).

## Actor input object example

```json
{
  "assets": [
    {
      "lat": 39.1463728,
      "lon": -77.0356535,
      "label": "Northwest Branch Anacostia River, MD (on a mapped impaired stream segment)"
    },
    {
      "lat": 39.5296,
      "lon": -117.0372,
      "label": "Rural Nevada desert site (expected clear)"
    }
  ],
  "radiusMiles": 1,
  "maxAssets": 200
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "assets": [
        {
            "lat": 39.1463728,
            "lon": -77.0356535,
            "label": "Northwest Branch Anacostia River, MD (on a mapped impaired stream segment)"
        },
        {
            "lat": 39.5296,
            "lon": -117.0372,
            "label": "Rural Nevada desert site (expected clear)"
        }
    ],
    "radiusMiles": 1,
    "maxAssets": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("malonestar/epa-impaired-waters-303d-screener").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "assets": [
        {
            "lat": 39.1463728,
            "lon": -77.0356535,
            "label": "Northwest Branch Anacostia River, MD (on a mapped impaired stream segment)",
        },
        {
            "lat": 39.5296,
            "lon": -117.0372,
            "label": "Rural Nevada desert site (expected clear)",
        },
    ],
    "radiusMiles": 1,
    "maxAssets": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("malonestar/epa-impaired-waters-303d-screener").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "assets": [
    {
      "lat": 39.1463728,
      "lon": -77.0356535,
      "label": "Northwest Branch Anacostia River, MD (on a mapped impaired stream segment)"
    },
    {
      "lat": 39.5296,
      "lon": -117.0372,
      "label": "Rural Nevada desert site (expected clear)"
    }
  ],
  "radiusMiles": 1,
  "maxAssets": 200
}' |
apify call malonestar/epa-impaired-waters-303d-screener --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=malonestar/epa-impaired-waters-303d-screener",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CWA 303(d) Impaired Waters Proximity Screener — NPDES/Phase-I",
        "description": "CWA Section 303(d) impaired-waters proximity API — screens coordinates against EPA ATTAINS impaired/threatened waters: nearest impaired stream or lake, distance, pollutant causes, TMDL status, and an NPDES/stormwater permitting flag for Phase-I ESA site due diligence.",
        "version": "1.0",
        "x-build-id": "EzcbOaCD8yXiXel7y"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/malonestar~epa-impaired-waters-303d-screener/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-malonestar-epa-impaired-waters-303d-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-impaired-waters-303d-screener/runs": {
            "post": {
                "operationId": "runs-sync-malonestar-epa-impaired-waters-303d-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-impaired-waters-303d-screener/run-sync": {
            "post": {
                "operationId": "run-sync-malonestar-epa-impaired-waters-303d-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",
                "required": [
                    "assets"
                ],
                "properties": {
                    "assets": {
                        "title": "Assets (coordinates to screen)",
                        "type": "array",
                        "description": "Site coordinates to screen against EPA CWA Section 303(d) impaired/threatened waters. Each item: { lat, lon, label? }. lat/lon are decimal degrees (WGS84); label is an optional free-text identifier echoed back on the output row (defaults to asset_1, asset_2, ...). One billable result row is returned per asset, even when the site is clear.",
                        "default": [
                            {
                                "lat": 39.1463728,
                                "lon": -77.0356535,
                                "label": "Northwest Branch Anacostia River, MD (on a mapped impaired stream segment)"
                            },
                            {
                                "lat": 39.5296,
                                "lon": -117.0372,
                                "label": "Rural Nevada desert site (expected clear)"
                            }
                        ]
                    },
                    "radiusMiles": {
                        "title": "Search radius (miles)",
                        "minimum": 0.1,
                        "maximum": 25,
                        "type": "number",
                        "description": "How far from each asset coordinate to search for CWA Section 303(d) impaired or threatened waterbodies, streams, and lakes. Minimum 0.1, maximum 25. Default 1 mile — a typical Phase-I / NPDES-permitting screening distance.",
                        "default": 1
                    },
                    "maxAssets": {
                        "title": "Max assets per run",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Safety cap on how many assets from the assets array will be screened in a single run (extra assets are skipped with a warning, not an error).",
                        "default": 200
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
