# EPA ECHO CWA Facilities Scraper — State Rosters (`devilscrapes/epa-echo-facilities-scraper`) Actor

Search EPA ECHO's Clean Water Act facility registry by US state and export flat rows — name, address, registry/source IDs, county, EPA region, permit status. Keyless federal API. Built for ESG analysts, environmental compliance teams and site-diligence buyers.

- **URL**: https://apify.com/devilscrapes/epa-echo-facilities-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## EPA ECHO CWA Facilities Scraper

**💰 $3.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*The devil's in the data — we pull the whole state roster.* 😈

Search EPA ECHO's Clean Water Act facility registry by US state and export flat rows — name, address, registry/source IDs, county, EPA region, permit status. Keyless federal API. Built for ESG analysts, environmental compliance teams and site-diligence buyers.

</div>

***

> **Quick answer:** This Actor pulls EPA ECHO's Clean Water Act facility
> registry for any US state and returns every regulated facility — name,
> address, registry ID, county, EPA region, and permit status — as flat
> JSON/CSV rows. No API key needed; you pay only for the facility rows
> that land in your dataset.

### 🎯 What this scrapes

EPA's ECHO (Enforcement and Compliance History Online) publishes every Clean Water Act–regulated facility, but pulling a full state roster means correctly handling ECHO's undocumented two-call protocol — a JSON search call that returns a query ID, then a single CSV download call that streams the entire result set at once with no server-side pagination. This Actor runs both calls, branches correctly on a match, a zero-match, or a rejected search, and flattens every facility — name, address, registry ID, county, EPA region, permit status — into one billable row.

### 🔥 What we handle for you

- 🧭 **The two-call protocol, done right** — one JSON search call, one CSV download call, exactly as ECHO expects. No guessed query params.
- 🧱 **Zero matches is a clean success, not a failure** — a narrow state/name combination finishes SUCCEEDED with a status message, never a false FAILED run.
- 🛡️ **We rotate browser fingerprints** (curl-cffi impersonation — Chrome/Firefox/Safari) on every request.
- 🔁 **Retries with exponential backoff** on `429 / 5xx`, honouring `Retry-After` — up to 5 attempts per call.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, one malformed CSV row skipped and logged, never an aborted run.
- 💰 **Pay-Per-Event pricing** — you only pay for results that hit your dataset.

### 💡 Use cases

- ESG and environmental due diligence — pull every CWA-regulated facility in a state before a site acquisition or portfolio review.
- Compliance monitoring — track permit status (e.g. `Effective`, `Administratively Continued`) across a jurisdiction.
- Market research — size the number of regulated dischargers by state or county.
- Lead generation for environmental consultancies and permit-renewal services.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Set a 2-letter `state` (defaults to `RI`); optionally narrow with `facilityName`.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `state` | `string` | yes | `RI` | 2-letter US state code. ECHO rejects an unfiltered query, so a state is mandatory. |
| `facilityName` | `string` | no | — | Optional substring match against the facility name, e.g. `hospital`. |
| `maxResults` | `integer` | no | `500` | Caps rows pushed after CSV parsing. Each row is one billed result event. |
| `proxyConfiguration` | `object` | no | `{"useApifyProxy": false}` | EPA ECHO is a public keyless federal API. Leave off unless your account requires egress through Apify Proxy. |

#### Example input

```json
{
  "state": "RI",
  "maxResults": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `facility_name` | `string` | Facility name, e.g. `ACME MANUFACTURING CO`. |
| `source_id` | `string` | State-issued source ID, e.g. `RI0001234`. |
| `street_address` | `string` | Facility street address. |
| `city` | `string` | Facility city. |
| `state` | `string` | 2-letter state code. |
| `registry_id` | `string` | EPA Facility Registry Service (FRS) registry ID. |
| `epa_system` | `string` | EPA regulatory system, e.g. `CWA`. |
| `statute` | `string` | Governing statute/program, e.g. `NPDES`. |
| `county` | `string` | Facility county. |
| `epa_region` | `string` | EPA region number, e.g. `01`. |
| `permit_status_desc` | `string` | Current permit status description, e.g. `Effective`. |
| `scraped_at` | `string` | ISO 8601 UTC timestamp when the row was scraped. |

#### Example output

```json
{
  "facility_name": "ACME MANUFACTURING CO",
  "source_id": "RI0001234",
  "street_address": "123 INDUSTRIAL DR",
  "city": "PROVIDENCE",
  "state": "RI",
  "registry_id": "110000123456",
  "epa_system": "CWA",
  "statute": "NPDES",
  "county": "PROVIDENCE",
  "epa_region": "01",
  "permit_status_desc": "Effective",
  "scraped_at": "2026-08-25T12:00:00+00:00"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | One-off warm-up charge per run |
| `result` | $0.003 | Per dataset item |

Example: 1 000 results at the rates above ≈ **$3.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Clean Water Act (CWA) facilities only — Air (CAA), RCRA, and Safe Drinking Water Act programs are separate ECHO products, out of scope for v1.
- No violation/inspection/penalty history — this Actor returns current facility and permit status, not enforcement records.
- No county-level query filter — ECHO silently no-ops unrecognized filter params, so county narrowing isn't offered; `county` remains in the output.
- Large states (e.g. California, ~30,000+ rows) return a correspondingly large CSV in one response — use `maxResults` and `facilityName` to narrow.

### ❓ FAQ

**Do I need an API key?**

No. EPA ECHO's CWA REST service is public and keyless — no auth, no account required.

**Why is `state` required?**

ECHO rejects a completely unfiltered query. A 2-letter state code is the minimum viable filter and keeps result sets to a sane size.

**What happens if my filters match nothing?**

The run finishes successfully with zero rows and a status message describing what was searched — a narrow state/name combination legitimately returning no facilities is not an error.

**Is this current or historical data?**

ECHO serves current-state data only. There is no point-in-time snapshot or historical query in v1.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `state` (type: `string`):

Required 2-letter US state code, e.g. <code>RI</code>. ECHO rejects an unfiltered query, so a state is mandatory. Normalized to uppercase.

## `facilityName` (type: `string`):

Optional substring match against the facility name, e.g. <code>hospital</code>. Leave blank to return every CWA-regulated facility in the state.

## `maxResults` (type: `integer`):

Stop once this many facility rows have been emitted. Each row is one billed result event. ECHO returns the full result set in a single download, so this caps rows client-side after parsing.

## `proxyConfiguration` (type: `object`):

EPA ECHO is a public keyless federal API with no observed anti-bot posture. Leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "state": "RI",
  "maxResults": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "state": "RI",
    "maxResults": 500,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/epa-echo-facilities-scraper").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 = {
    "state": "RI",
    "maxResults": 500,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/epa-echo-facilities-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "state": "RI",
  "maxResults": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/epa-echo-facilities-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/epa-echo-facilities-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AOL3v7jqtxthxwwVA/builds/7g4ehJSocdKncPEQR/openapi.json
