# EPA Data API - ECHO Facility Violations & Compliance Scraper (`captainhandsome/epa-echo-facility-search`) Actor

Search EPA ECHO for US facilities by state, city, ZIP, NAICS/SIC code or programme (Clean Air Act, Clean Water Act, RCRA). Environmental compliance data: filter for violations and significant noncompliance, and pull inspection and penalty history per facility.

- **URL**: https://apify.com/captainhandsome/epa-echo-facility-search.md
- **Developed by:** [Joseph McRell](https://apify.com/captainhandsome) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 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/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

## EPA ECHO Facility Search

Search the official EPA ECHO service for regulated US facilities by state, ZIP code, name, NAICS code, environmental program, or violation status. Export normalized compliance, inspection, and penalty fields without an API key. Set `max_items` before each run to keep output and cost predictable.

### What data can I extract?

160 flat columns per facility, straight from the official EPA ECHO service. Nested
values are flattened into scalar columns, so a CSV export needs no post-processing.

- **Identity and location** - registry ID, name, address, county, FIPS, latitude and
  longitude, plus the coordinate accuracy, collection method and reference point so
  you can tell a surveyed point from a geocoded address.
- **Jurisdiction** - EPA region, congressional district, census block group,
  HUC8 and HUC12 watershed codes and names, Indian country flag and nearby tribes.
- **Program participation** - one Y/N column per program (Clean Air Act, NPDES water,
  Safe Drinking Water, RCRA hazardous waste, Toxics Release Inventory, greenhouse gas
  reporting, Superfund) and the matching program IDs, which are the join keys into
  EPA's other public datasets.
- **Compliance** - overall status plus per-program status, significant non-compliance
  and high priority violator flags, and the quarter-by-quarter compliance history
  strings for each program.
- **Inspections and enforcement** - counts and latest dates, split by program and by
  whether EPA or the state carried the action out.
- **Penalties** - totals, counts, latest amounts and dates, broken out per program and
  for federal enforcement cases.
- **Emissions** - Toxics Release Inventory on-site releases and off-site transfers in
  pounds, and greenhouse gas CO2 equivalent in metric tons.
- **Environmental justice** - percent minority, percent people of colour, percent low
  income and population density around the site, plus nonattainment-area status and
  the pollutants involved.
- **Permits and demographics** (optional, `include_details`) - permit expiration dates,
  permit statutes, universes and areas, and the ACS demographic block around the site.

Every result is written to the default dataset and can be downloaded as JSON, CSV, Excel, or XML.

#### All 160 columns

**Identity** — `air_ids`, `federal_agency_name`, `federal_case_ids`, `ghg_ids`, `name`, `npdes_ids`, `rcra_ids`, `registry_id`, `rmp_ids`, `sdwa_ids`, `superfund_ids`, `tri_ids`, `watershed_huc12_name`, `watershed_huc8_name`

**Status** — `active`, `caa_permit_types`, `caa_status`, `compliance_status`, `cwa_permit_types`, `cwa_status`, `rcra_permit_types`, `rcra_status`, `sdwa_status`, `sdwa_system_types`

**Dates** — `caa_last_formal_action_date`, `caa_last_penalty_date`, `cwa_last_formal_action_date`, `cwa_last_penalty_date`, `federal_last_case_date`, `last_formal_action_date`, `last_formal_action_date_epa`, `last_formal_action_date_state`, `last_informal_action_date`, `last_informal_action_date_epa`, `last_informal_action_date_state`, `last_inspection_date`, `last_inspection_date_epa`, `last_inspection_date_state`, `last_penalty_date`, `permit_expiration_dates`, `rcra_last_formal_action_date`, `rcra_last_penalty_date`

**Location** — `city`, `congressional_district`, `county`, `epa_region`, `fips_code`, `in_indian_country`, `latitude`, `longitude`, `state`, `zip`

**Money** — `acs_percent_below_low_income`, `acs_persons_below_low_income`, `caa_last_penalty_amount`, `caa_penalties`, `cwa_last_penalty_amount`, `cwa_penalties`, `federal_case_penalties`, `last_penalty_amount`, `penalty_count`, `percent_below_low_income`, `rcra_last_penalty_amount`, `rcra_penalties`, `total_penalties`

**Contact** — `url`

**Counts and measures** — `caa_evaluation_count`, `caa_formal_action_count`, `caa_informal_count`, `cwa_formal_action_count`, `cwa_informal_count`, `cwa_inspection_count`, `federal_case_count`, `formal_action_count`, `informal_action_count`, `inspection_count`, `permit_count`, `rcra_formal_action_count`, `rcra_informal_count`, `rcra_inspection_count`, `sdwa_formal_action_count`, `sdwa_informal_count`

**Other detail** — `acs_households`, `acs_households_public_assistance`, `acs_housing_units`, `acs_minors`, `acs_percent_below_poverty`, `acs_persons_below_poverty`, `acs_population`, `acs_radius_miles`, `acs_seniors`, `caa_compliance_history_3yr`, `caa_days_last_evaluation`, `caa_high_priority_violator`, `caa_quarters_in_noncompliance`, `census_block_group`, `compliance_history_3yr`, `coordinate_accuracy_meters`, `coordinate_collection_method`, `coordinate_reference_point`, `current_violation`, `currently_significant_violation`, `cwa_compliance_history_13qtrs`, `cwa_compliance_tracking`, `cwa_days_last_inspection`, `cwa_effluent_exceedances_13qtrs`, `cwa_qncr_codes`, `cwa_quarters_in_noncompliance`, `cwa_significant_noncompliance`, `days_since_inspection`, `discharges_to_impaired_water`, `epcra_inspections_5yr`, `federal_facility`, `fifra_inspections_5yr`, `formal_action_last_5yr`, `ghg_co2_releases_tons`, `had_violation_3yr`, `in_air_program`, `in_drinking_water_program`, `in_greenhouse_gas_reporting`, `in_hazardous_waste_program`, `in_nonattainment_area`, `in_superfund_program`, `in_toxics_release_inventory`, `in_water_program`, `informal_action_last_5yr`, `inspected_last_5yr`, `latest_permit_expiration`, `major_facility`, `naics_codes`, `nearby_tribes`, `nonattainment_categories`, `nonattainment_pollutants`, `percent_minority`, `percent_people_of_color`, `permit_areas`, `permit_statutes`, `permit_universes`, `population_density`, `programs_with_snc`, `quarters_in_noncompliance`, `rcra_compliance_history_3yr`, `rcra_days_last_evaluation`, `rcra_quarters_in_noncompliance`, `rcra_significant_noncompliance`, `sdwa_compliance_history_3yr`, `sdwa_inspections_5yr`, `sdwa_quarters_in_noncompliance`, `sdwa_significant_noncompliance`, `sic_codes`, `significant_noncompliance`, `street`, `tri_off_site_transfers_lbs`, `tri_on_site_releases_lbs`, `tri_releases_transfers_lbs`, `tri_reporter`, `tri_reporter_in_past`, `tsca_inspections_5yr`, `watershed_huc12`, `watershed_huc8`

### Input example

```json
{
  "state": "RI",
  "program": "A",
  "violations_only": true,
  "max_items": 10
}
```

The default input is deliberately bounded and produces a small, useful Store test. `max_items` is a hard output ceiling.

### Output example

An abridged real record - the full row carries 160 columns:

```json
{
  "registry_id": "110007019190",
  "name": "CNTRL LANDFILL RESOURCE RECOVERY PLANT",
  "street": "65 SHUN PIKE",
  "city": "JOHNSTON",
  "state": "RI",
  "zip": "02919",
  "county": "PROVIDENCE",
  "latitude": 41.808331,
  "longitude": -71.534719,
  "epa_region": "01",
  "congressional_district": "02",
  "watershed_huc8_name": "Narragansett",
  "naics_codes": "562212 999999 221119 22111 562111",
  "major_facility": "Y",
  "in_air_program": "Y",
  "in_water_program": "Y",
  "in_superfund_program": "Y",
  "npdes_ids": "RI0023442, RIR100390, RIR100645, RIR101096",
  "superfund_ids": "RID980520183",
  "caa_permit_types": "Major Emissions, Minor Emissions",
  "compliance_status": "Violation Identified",
  "caa_status": "Violation w/in 1 Year",
  "cwa_status": "Violation Identified",
  "current_violation": 1,
  "quarters_in_noncompliance": 10,
  "compliance_history_3yr": "SSSS_VVSS_VV",
  "inspection_count": 7,
  "last_inspection_date": "09/02/2026",
  "formal_action_count": 1,
  "last_penalty_date": "02/24/2020",
  "ghg_co2_releases_tons": 5354.0,
  "discharges_to_impaired_water": "Y",
  "in_nonattainment_area": "Y",
  "nonattainment_pollutants": "Ozone",
  "percent_people_of_color": 24.15,
  "percent_below_low_income": 19.21,
  "latest_permit_expiration": "03/31/2027",
  "url": "https://echo.epa.gov/detailed-facility-report?fid=110007019190"
}
```

`compliance_history_3yr` gives one character per quarter, oldest first: an underscore
is a compliant quarter and a letter marks a violation, so a whole three-year trend
reads at a glance.

Nullable fields remain explicit when the upstream source does not supply a value.
`latest_permit_expiration` and the `acs_*` columns need `include_details`; they are
returned as null otherwise, so the column set never changes between runs.

### Common use cases

- Environmental due diligence
- Supplier and site compliance research
- Facility prospecting by industry
- Public-interest and enforcement analysis

### Use with AI agents and MCP

Apify's MCP server can discover and call this Actor from an AI workflow. Example intent:

> Find 10 Rhode Island Clean Air Act facilities currently flagged for violations.

Use the JSON from **Input example** as the tool arguments. The strict input schema rejects unsupported parameters, and the documented dataset schema tells the agent how to interpret each returned field.

### Pricing and cost control

Output is billed per result at **$0.003 per result** (about $3.00 per 1,000 results), plus a $0.0005 Actor-start charge billed once per gigabyte of memory at run start. Use `max_items` to cap both output volume and charges. The price shown on the Apify Store listing is authoritative.

`max_items` limits both output volume and result-based charges. Start with 10 records, inspect them, and then scale deliberately.

### Reliability

The Actor validates input, bounds pagination, retries transient upstream failures, writes structured records, and fails explicitly when the source cannot produce usable output. A production default-input canary is monitored by the fleet.

### Limitations and responsible use

- ECHO status reflects EPA source systems and reporting schedules.
- A flagged record is a research lead, not a legal conclusion.
- Some fields are unavailable for some programs or facilities.
- This Actor does not bypass EPA limits or access nonpublic records.

Use the data lawfully, respect source terms, and independently validate records before making consequential decisions.

### FAQ

#### Does it need my own API key?

No, the default workflow does not require a customer-supplied API key.

#### Can I export the results?

Yes. Download the default dataset as JSON, CSV, Excel, or XML, or retrieve it through the Apify API.

#### How do I control cost?

Set `max_items` to the most records you want returned. Begin with the bounded default input.

#### Can an AI agent call it?

Yes. The Actor has strict input and semantic output schemas and can be called through Apify's MCP tooling.

#### What happens when a source field is missing?

The relevant field is returned as null or an empty normalized value rather than being merged into another field.

# Actor input Schema

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

Two-letter state code, e.g. RI.

## `city` (type: `string`):

City name.

## `county` (type: `string`):

County name.

## `zip` (type: `string`):

Five-digit ZIP code.

## `facility_name` (type: `string`):

Part of the facility name.

## `naics_code` (type: `string`):

Industry code, e.g. 327910.

## `sic_code` (type: `string`):

Older industry code, e.g. 3496.

## `program` (type: `string`):

Limit to facilities regulated under one programme. Verified by checking which compliance column comes back populated.

## `major_facilities_only` (type: `boolean`):

Only facilities EPA classifies as major emitters or dischargers.

## `active_only` (type: `boolean`):

Exclude facilities no longer operating.

## `include_details` (type: `boolean`):

Also fetch each facility's detailed report for permit expiration dates, permit universes and the ACS demographic block around the site. Costs one extra request per facility, so runs take noticeably longer. Off by default; the columns are still present, as empty values.

## `violations_only` (type: `boolean`):

Keep only facilities currently showing a violation or significant non-compliance. Applied to returned rows: EPA offers no server-side filter for this.

## `max_items` (type: `integer`):

Hard cap on facilities returned. Also caps your spend.

## Actor input object example

```json
{
  "state": "RI",
  "program": "A",
  "major_facilities_only": false,
  "active_only": false,
  "include_details": false,
  "violations_only": true,
  "max_items": 10
}
```

# Actor output Schema

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

Structured records from the default dataset.

# 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"
};

// Run the Actor and wait for it to finish
const run = await client.actor("captainhandsome/epa-echo-facility-search").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" }

# Run the Actor and wait for it to finish
run = client.actor("captainhandsome/epa-echo-facility-search").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"
}' |
apify call captainhandsome/epa-echo-facility-search --silent --output-dataset

```

## MCP server setup

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

```

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/wBYHZ8c7falyUek29/builds/MQqCPSKOFhtWX7x9E/openapi.json
