# EPA ECHO Environmental Compliance Search (`ryanclinton/epa-echo-search`) Actor

EPA ECHO Environmental Compliance Search is an Apify actor that queries the U.S. Environmental Protection Agency's Enforcement and Compliance History Online (ECHO) database for facility-level environmental compliance data.

- **URL**: https://apify.com/ryanclinton/epa-echo-search.md
- **Developed by:** [ryan clinton](https://apify.com/ryanclinton) (community)
- **Categories:** Other, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$30.00 / 1,000 result returneds

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/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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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 ECHO Environmental Compliance Search

### What does EPA ECHO Environmental Compliance Search do?

EPA ECHO Environmental Compliance Search is an Apify actor that queries the U.S. Environmental Protection Agency's Enforcement and Compliance History Online (ECHO) database for facility-level environmental compliance data. ECHO aggregates regulatory information from multiple EPA programs -- Clean Air Act (CAA), Clean Water Act (CWA), Resource Conservation and Recovery Act (RCRA), Safe Drinking Water Act (SDWA), Toxics Release Inventory (TRI), Greenhouse Gas Reporting (GHG), and Risk Management Plan (RMP) -- into a single searchable interface covering hundreds of thousands of regulated facilities nationwide.

This actor automates the process of searching ECHO for facilities matching your criteria, extracting compliance status, inspection history, enforcement actions, penalty amounts, and environmental justice indicators. It handles the EPA's two-step query pattern (search, then paginate by query ID), rate limiting, and optional deep-dive Detailed Facility Reports (DFR) that provide permit-level, violation-level, and inspection-level records for each facility.

Whether you are an environmental consultant screening facilities for compliance risk, a journalist investigating pollution violators, an ESG analyst building corporate environmental profiles, a community activist tracking local polluters, or a compliance officer monitoring your own facilities, this actor delivers structured, machine-readable EPA enforcement data without the complexity of navigating the ECHO website or constructing raw API queries.

No API key is required. All data comes from the public EPA ECHO REST API at echodata.epa.gov and is freely available as U.S. government public information.

### Features

- Search by facility name, state, city, ZIP code, county, or EPA region
- Filter by NAICS or SIC industry classification codes (prefix matching)
- Filter by environmental program (CAA, CWA, RCRA, SDWA, TRI, GHG, RMP)
- Filter by compliance status: any noncompliance, significant noncompliance in one or more programs
- Filter by penalty history: any penalty, never penalized, penalty within or over 12/24 months
- Filter by major or minor facility designation
- Filter for federal government facilities only
- Filter by formal enforcement actions in the last 5 years
- Filter by inspection history: inspected within X years, not inspected within X years, or never inspected
- Optional Detailed Facility Report (DFR) with permits, formal actions, inspections, and violations per facility
- Up to 10,000 facility records per run
- Automatic pagination through the EPA ECHO two-step query pattern
- Built-in retry logic with exponential backoff for rate limiting
- No API key or authentication required
- Summary statistics logged after each run (state distribution, program breakdown, penalty totals)

### How to use

1. **Configure your search** -- Set your filters using any combination of location, industry, program, compliance status, and enforcement history parameters. At minimum, provide a state, facility name, or industry code to focus your search. If you run with no inputs, the actor defaults to facilities with significant noncompliance nationwide.

2. **Run the actor** -- Click "Start" to execute your search. The actor queries the EPA ECHO API, paginates through all matching results, optionally fetches Detailed Facility Reports, and pushes clean data to the output dataset.

3. **Enable detailed reports (optional)** -- Set `includeDetailedReport` to true to fetch permit, enforcement, inspection, and violation details for each facility. This makes one additional API call per facility and is best used with smaller result sets (under 500).

4. **Schedule recurring runs** -- Use Apify's scheduler to run the actor daily or weekly for ongoing compliance monitoring. Pair with Slack, email, or webhook integrations for automated alerts when new violators appear.

5. **Export or integrate** -- Download results as JSON, CSV, or Excel from the Dataset tab. Or use the Apify API, webhooks, Google Sheets, Slack, or Zapier integrations for automated workflows.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `facilityName` | String | No | -- | Facility name to search (partial match, CONTAINS). Examples: `"EXXON"`, `"DOW CHEMICAL"`, `"TYSON"`. |
| `state` | String | No | `"TX"` (prefill) | U.S. state filter (2-letter code). Comma-separate for multiple: `"TX,CA,OH"`. |
| `city` | String | No | -- | City name filter. Examples: `"HOUSTON"`, `"LOS ANGELES"`. |
| `zipCode` | String | No | -- | 5-digit ZIP code. Comma-separate for multiple: `"77001,77002"`. |
| `county` | String | No | -- | County name (use together with state for best results). |
| `epaRegion` | Select | No | -- | EPA region number (01-10). See EPA Regions reference below. |
| `naicsCode` | String | No | -- | NAICS industry code prefix (2-6 digits). `"324"` matches all Petroleum/Coal Manufacturing. `"562"` matches Waste Management. |
| `sicCode` | String | No | -- | SIC industry code prefix (2-4 digits). `"29"` matches Petroleum Refining. `"49"` matches Electric/Gas/Sanitary. |
| `program` | Select | No | -- | Environmental program filter: Air (CAA), Water (CWA), RCRA, SDWA, TRI, GHG, or RMP. |
| `complianceStatus` | Select | No | -- | Compliance status: Any Noncompliance, 1+ Programs with Significant NC, or 2+ Programs with Significant NC. |
| `penaltyFilter` | Select | No | -- | Penalty history: Any Penalty, Never Penalized, Penalty within 12 months, over 12 months, within 24 months, over 24 months. |
| `majorFacility` | Select | No | -- | Major Only or Minor Only. Major facilities have higher emissions/discharge levels and stricter regulatory requirements. |
| `federalFacility` | Boolean | No | `false` | Only return federal government facilities (military bases, federal buildings, etc.). |
| `formalEnforcement` | Boolean | No | `false` | Only return facilities with formal enforcement actions in the last 5 years. |
| `inspectionFilter` | Select | No | -- | Inspection history: Inspected Within X Years, Not Inspected Within X Years, or Never Inspected. |
| `inspectionYears` | Integer | No | `3` | Number of years for the inspection filter (1-5). Only used when `inspectionFilter` is "Within" or "Not Within". |
| `includeDetailedReport` | Boolean | No | `false` | Fetch the Detailed Facility Report (DFR) for each facility. Includes permits, formal actions, inspections, and violations. Makes one extra API call per facility. |
| `maxResults` | Integer | No | `100` | Maximum number of facility records to return (1-10,000). |

#### Input examples

**Significant violators in Texas:**

```json
{
    "state": "TX",
    "complianceStatus": "3",
    "maxResults": 200
}
````

**Petroleum refineries with Clean Air Act violations:**

```json
{
    "naicsCode": "324",
    "program": "A",
    "complianceStatus": "2",
    "maxResults": 500
}
```

**Facilities never inspected in California waste management industry:**

```json
{
    "state": "CA",
    "naicsCode": "562",
    "inspectionFilter": "NV",
    "maxResults": 300
}
```

**Federal facilities with formal enforcement and detailed reports:**

```json
{
    "federalFacility": true,
    "formalEnforcement": true,
    "includeDetailedReport": true,
    "maxResults": 50
}
```

**Major facilities penalized within 12 months in EPA Region 05 (Great Lakes):**

```json
{
    "epaRegion": "05",
    "majorFacility": "Y",
    "penaltyFilter": "LE12",
    "includeDetailedReport": true,
    "maxResults": 100
}
```

**Search by facility name with detailed report:**

```json
{
    "facilityName": "DOW CHEMICAL",
    "includeDetailedReport": true,
    "maxResults": 50
}
```

#### Input tips

- **Combine state with industry code** for targeted regional analysis. Using industry code alone may return thousands of results across all states.
- **NAICS prefix matching** means `"32"` matches all manufacturing codes (32xxxx). Use 3-4 digit codes for specific subsectors.
- **Default behavior with no input** returns 100 facilities with significant noncompliance in at least one program nationwide. This is a useful starting point for exploring the data.
- **Enable `includeDetailedReport` selectively** -- Each DFR adds an extra API call, so keep `maxResults` under 500 when using this option to avoid long run times.
- **Use `complianceStatus: "4"`** to find the worst offenders -- facilities with significant noncompliance in two or more programs simultaneously.
- **Inspection filter `NV` (Never Inspected)** reveals facilities that have never received a compliance inspection, which can indicate oversight gaps.
- **Penalty filter `NEVER`** identifies facilities that have never been financially penalized, even if they have violations on record.

### Output format

Each facility in the output dataset contains the following fields:

```json
{
    "registryId": "110070350174",
    "facilityName": "MARATHON PETROLEUM COMPANY LP - GALVESTON BAY REFINERY",
    "street": "2401 5TH AVE S",
    "city": "TEXAS CITY",
    "state": "TX",
    "zipCode": "77590",
    "county": "GALVESTON",
    "latitude": 29.3847,
    "longitude": -94.9125,
    "epaRegion": "06",
    "fipsCode": "48167",
    "sicCodes": "2911",
    "naicsCodes": "324110",
    "programs": ["CAA", "CWA", "RCRA", "TRI"],
    "majorFacility": true,
    "activeFacility": true,
    "complianceStatus": "Significant Noncompliance",
    "significantNoncompliance": true,
    "quartersInNoncompliance": 8,
    "caaComplianceStatus": "High Priority Violation",
    "cwaComplianceStatus": "Significant Noncompliance",
    "rcraComplianceStatus": "In Compliance",
    "sdwaComplianceStatus": "",
    "inspectionCount": 14,
    "lastInspectionDate": "09/15/2025",
    "lastFormalActionDate": "03/22/2025",
    "lastPenaltyDate": "03/22/2025",
    "totalPenalties": 387500,
    "penaltyCount": 3,
    "formalActionCount": 5,
    "caa3yrHistory": "VVVVVVVVNNNN",
    "cwa3yrHistory": "VVNNNNNNNNNN",
    "rcra3yrHistory": "NNNNNNNNNNNN",
    "triReleasesTransfers": "4,523,100",
    "percentMinority": 42.3,
    "populationDensity": 1847.5,
    "detailedReport": {
        "permits": [
            {
                "SourceID": "TX0001234",
                "ProgramAcronym": "CWA",
                "PermitName": "TPDES PERMIT",
                "ExpirationDate": "09/30/2027",
                "Status": "Effective"
            }
        ],
        "formalActions": [
            {
                "StatuteAcronym": "CAA",
                "ActionType": "Formal Enforcement Action",
                "ActionDate": "03/22/2025",
                "Penalty": "$250,000",
                "LeadAgency": "EPA"
            }
        ],
        "inspections": [
            {
                "StatuteAcronym": "CAA",
                "InspectionType": "Compliance Evaluation Inspection",
                "ComplianceMonitoringActivityDate": "09/15/2025",
                "FindingSummary": "Violation Identified",
                "LeadAgency": "State"
            }
        ],
        "violations": [
            {
                "StatuteAcronym": "CWA",
                "ViolationType": "Effluent",
                "Pollutant": "Total Suspended Solids",
                "ComplianceScheduleDate": "01/31/2025",
                "ActualDate": "03/15/2025",
                "Agency": "State"
            }
        ]
    },
    "echoUrl": "https://echo.epa.gov/detailed-facility-report?fid=110070350174",
    "extractedAt": "2026-02-25T14:30:00.000Z"
}
```

#### Output fields reference

| Field | Type | Description |
|-------|------|-------------|
| `registryId` | String | Unique EPA Facility Registry Service (FRS) identifier |
| `facilityName` | String | Official facility name as registered with EPA |
| `street` | String | Street address |
| `city` | String | City |
| `state` | String | Two-letter state code |
| `zipCode` | String | 5-digit ZIP code |
| `county` | String | County name |
| `latitude` | Number/null | Geographic latitude |
| `longitude` | Number/null | Geographic longitude |
| `epaRegion` | String | EPA regional office number (01-10) |
| `fipsCode` | String | Federal Information Processing Standard county code |
| `sicCodes` | String | Standard Industrial Classification code(s) |
| `naicsCodes` | String | North American Industry Classification System code(s) |
| `programs` | Array | Environmental programs the facility is regulated under (CAA, CWA, RCRA, SDWA, TRI, GHG) |
| `majorFacility` | Boolean | Whether the facility is classified as a major source/discharger |
| `activeFacility` | Boolean | Whether the facility is currently active |
| `complianceStatus` | String | Overall compliance status description |
| `significantNoncompliance` | Boolean | Whether the facility is flagged for significant noncompliance (SNC) in any program |
| `quartersInNoncompliance` | Number | Number of quarters the facility has been in noncompliance |
| `caaComplianceStatus` | String | Clean Air Act compliance status |
| `cwaComplianceStatus` | String | Clean Water Act compliance status |
| `rcraComplianceStatus` | String | RCRA (hazardous waste) compliance status |
| `sdwaComplianceStatus` | String | Safe Drinking Water Act compliance status |
| `inspectionCount` | Number | Total number of compliance inspections on record |
| `lastInspectionDate` | String/null | Date of the most recent inspection |
| `lastFormalActionDate` | String/null | Date of the most recent formal enforcement action |
| `lastPenaltyDate` | String/null | Date of the most recent penalty assessment |
| `totalPenalties` | Number | Cumulative dollar amount of assessed penalties |
| `penaltyCount` | Number | Total number of penalties assessed |
| `formalActionCount` | Number | Total number of formal enforcement actions |
| `caa3yrHistory` | String | 12-character quarterly compliance history for CAA (V=violation, N=no violation, newest first) |
| `cwa3yrHistory` | String | 12-character quarterly compliance history for CWA |
| `rcra3yrHistory` | String | 12-character quarterly compliance history for RCRA |
| `triReleasesTransfers` | String | Total pounds of toxic releases and transfers reported to TRI |
| `percentMinority` | Number/null | Percentage of minority population within 3 miles of the facility (environmental justice indicator) |
| `populationDensity` | Number/null | Population density per square mile within 3 miles |
| `detailedReport` | Object/null | Detailed Facility Report data (only present when `includeDetailedReport` is true) |
| `echoUrl` | String | Direct link to the facility's page on EPA ECHO website |
| `extractedAt` | String | ISO 8601 timestamp of when the data was extracted |

#### Detailed Report fields

When `includeDetailedReport` is enabled, each facility includes a `detailedReport` object containing:

| Sub-field | Type | Contents |
|-----------|------|----------|
| `permits` | Array | Active and expired permits with ID, program, name, expiration date, and status |
| `formalActions` | Array | Formal enforcement actions with statute, action type, date, penalty amount, and lead agency |
| `inspections` | Array | Compliance inspections with statute, type, date, finding summary, and lead agency |
| `violations` | Array | Compliance violations with statute, type, pollutant, scheduled and actual dates, and agency |

### Example use cases

**Environmental compliance auditing** -- A compliance officer at a manufacturing company runs monthly searches for their facilities by name to verify that all sites remain in compliance. They enable detailed reports to review permit status and flag upcoming expirations. Noncompliance findings are routed to site managers for corrective action.

**Investigative environmental journalism** -- A reporter searches for facilities with significant noncompliance in two or more programs (`complianceStatus: "4"`) in a specific state, focusing on facilities with large penalties. They cross-reference TRI release data with nearby population demographics using the `percentMinority` and `populationDensity` fields to investigate environmental justice concerns.

**ESG and corporate sustainability analysis** -- An ESG analyst searches for all facilities associated with a publicly traded company by name, then aggregates compliance status, penalty totals, and TRI releases across all sites to build an environmental performance score. They track this monthly using scheduled runs and compare against industry peers.

**Environmental due diligence for M\&A** -- A private equity firm evaluating a potential acquisition searches for all facilities owned by the target company. They enable detailed reports to review enforcement actions, outstanding violations, and permit compliance to assess environmental liabilities before closing the deal.

**Community environmental monitoring** -- A neighborhood advocacy group searches by ZIP code or county to identify all regulated facilities in their area. They use the penalty history and compliance status filters to find chronic violators and present findings at public hearings. Environmental justice indicators help quantify the disproportionate impact on minority communities.

**Regulatory gap analysis** -- A policy researcher searches for facilities that have never been inspected (`inspectionFilter: "NV"`) in a specific industry and region to identify potential regulatory blind spots. They combine this with major facility filtering to find high-risk sites that may warrant increased oversight.

**Insurance environmental risk underwriting** -- An insurance underwriter searches by NAICS code and state to assess the environmental compliance profile of a prospective policyholder's industry and geography. Facilities with recent penalties or formal enforcement actions indicate higher environmental liability risk.

**Supply chain environmental screening** -- A procurement team searches for key suppliers by facility name to screen for environmental violations. Suppliers with significant noncompliance or recurring penalties are flagged for additional review or corrective action requirements in vendor agreements.

### Environmental programs reference

| Code | Program | Full Name | What It Covers |
|------|---------|-----------|----------------|
| CAA | Air | Clean Air Act | Air pollutant emissions from stationary sources. Covers permits (Title V), emission standards (NESHAP/NSPS), and criteria pollutants. |
| CWA | Water | Clean Water Act | Wastewater discharges to surface waters. Covers NPDES permits, effluent limits, and pretreatment standards. |
| RCRA | Waste | Resource Conservation and Recovery Act | Generation, transport, treatment, storage, and disposal of hazardous waste. Covers permits, manifests, and corrective action. |
| SDWA | Drinking Water | Safe Drinking Water Act | Public water systems and underground injection control. Covers maximum contaminant levels and treatment technique requirements. |
| TRI | Toxics | Toxics Release Inventory | Reporting of toxic chemical releases and waste management. Covers ~770 chemicals from ~21,000 facilities. |
| GHG | Greenhouse Gas | GHG Reporting Program | Reporting of greenhouse gas emissions from large sources. Covers facilities emitting 25,000+ metric tons CO2e per year. |
| RMP | Risk Management | Risk Management Plan | Facilities that use extremely hazardous substances above threshold quantities. Covers accident prevention and emergency response planning. |

### Compliance status codes reference

The EPA uses several compliance status levels that appear in the output data:

| Status | Meaning |
|--------|---------|
| No Violation | Facility is in full compliance across all inspected programs |
| Noncompliance | Facility has one or more compliance issues that do not rise to significant level |
| Significant Noncompliance (SNC) | Facility has serious, persistent, or high-priority violations requiring formal enforcement |
| High Priority Violation (HPV) | CAA-specific designation for the most serious air quality violations |
| In Violation | Facility has current unresolved violations |
| In Compliance | Facility is meeting all current regulatory requirements for a given program |
| Resolved | Previously identified violations have been corrected |

#### 3-Year Compliance History codes

The `caa3yrHistory`, `cwa3yrHistory`, and `rcra3yrHistory` fields contain 12-character strings representing quarterly compliance over the past 3 years (newest quarter first):

| Character | Meaning |
|-----------|---------|
| V | Violation during that quarter |
| N | No violation during that quarter |
| (blank/space) | No data for that quarter |

Example: `"VVVVNNNNNNNN"` means the facility had violations in the most recent 4 quarters but was compliant in the 8 quarters before that.

### EPA regions reference

| Region | Code | States/Territories Covered | Regional Office |
|--------|------|---------------------------|-----------------|
| Region 1 | 01 | CT, MA, ME, NH, RI, VT | Boston, MA |
| Region 2 | 02 | NJ, NY, PR, VI | New York, NY |
| Region 3 | 03 | DC, DE, MD, PA, VA, WV | Philadelphia, PA |
| Region 4 | 04 | AL, FL, GA, KY, MS, NC, SC, TN | Atlanta, GA |
| Region 5 | 05 | IL, IN, MI, MN, OH, WI | Chicago, IL |
| Region 6 | 06 | AR, LA, NM, OK, TX | Dallas, TX |
| Region 7 | 07 | IA, KS, MO, NE | Kansas City, KS |
| Region 8 | 08 | CO, MT, ND, SD, UT, WY | Denver, CO |
| Region 9 | 09 | AZ, CA, HI, NV, AS, GU, MP | San Francisco, CA |
| Region 10 | 10 | AK, ID, OR, WA | Seattle, WA |

### Limitations and data freshness

- **No API key required** -- This actor queries public EPA data and does not require any authentication or API key.
- **10,000 facility cap per run** -- The actor limits output to 10,000 facilities per execution. For larger datasets, run multiple times with different state or region filters.
- **EPA API pagination limit** -- The EPA ECHO API allows up to 70,000 results per query with a maximum of 1,000 per page. The actor handles pagination automatically.
- **Rate limiting** -- The EPA API may return HTTP 429 responses under heavy load. The actor includes automatic retry logic with exponential backoff (up to 3 retries per request).
- **Data freshness** -- ECHO data is updated regularly but not in real time. Inspection data may lag by days or weeks. Enforcement actions and penalties may take months to appear after case resolution. TRI data is reported annually.
- **Detailed reports add latency** -- Enabling `includeDetailedReport` adds one API call per facility. For 500 facilities, expect the run to take several minutes due to request pacing.
- **Facility name matching is partial** -- The `facilityName` parameter uses CONTAINS matching, so `"DOW"` will match "DOW CHEMICAL", "DOWDUPONT", "MEADOWBROOK", etc. Be specific to avoid unwanted matches.
- **NAICS/SIC prefix matching** -- Short code prefixes (2 digits) match broadly across an entire industry sector. Use 3-6 digit codes for more precise targeting.
- **Environmental justice data** -- The `percentMinority` and `populationDensity` fields are derived from census block group data and may not reflect current demographics exactly.
- **State data variation** -- States with delegated authority to administer federal environmental programs may have different data completeness and timeliness compared to facilities directly overseen by EPA regional offices.

### Responsible use

- **Public data** -- All information returned by this actor is published by the U.S. Environmental Protection Agency as public record. ECHO data is explicitly intended for public access and transparency.
- **Compliance status is not a final judgment** -- Facilities may be in the process of resolving violations, contesting enforcement actions, or negotiating consent agreements. Present data with appropriate context.
- **Fair interpretation of penalties** -- Penalty amounts reflect EPA or state assessments and may be adjusted through settlement or appeal. Do not present initial penalty amounts as final unless confirmed by the enforcement action record.
- **Environmental justice context** -- When using demographic data (percent minority, population density) in analysis, provide appropriate context and avoid drawing causal conclusions from correlations alone.
- **No harassment** -- Do not use facility or compliance data to harass, threaten, or intimidate facility operators, employees, or nearby residents.
- **Attribution** -- When publishing EPA ECHO data, attribute it to the U.S. Environmental Protection Agency ECHO program.
- **Respect rate limits** -- The actor includes built-in request pacing and retry logic. Do not modify the actor to bypass rate limits or flood the EPA API with excessive requests.

### Integrations and API access

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_API_TOKEN")

run = client.actor("ryanclinton/epa-echo-search").call(run_input={
    "state": "TX",
    "naicsCode": "324",
    "complianceStatus": "3",
    "includeDetailedReport": True,
    "maxResults": 100,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    programs = ", ".join(item.get("programs", []))
    print(f"{item['facilityName']} — {item['city']}, {item['state']}")
    print(f"  Programs: {programs}")
    print(f"  Compliance: {item['complianceStatus']} | SNC: {item['significantNoncompliance']}")
    print(f"  Penalties: ${item['totalPenalties']:,.0f} | Inspections: {item['inspectionCount']}")
    if item.get("detailedReport"):
        dfr = item["detailedReport"]
        print(f"  Permits: {len(dfr['permits'])} | Violations: {len(dfr['violations'])}")
```

#### JavaScript

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

const client = new ApifyClient({ token: "YOUR_APIFY_API_TOKEN" });

const run = await client.actor("ryanclinton/epa-echo-search").call({
    state: "TX",
    naicsCode: "324",
    complianceStatus: "3",
    includeDetailedReport: true,
    maxResults: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    const programs = (item.programs || []).join(", ");
    console.log(`${item.facilityName} — ${item.city}, ${item.state}`);
    console.log(`  Programs: ${programs}`);
    console.log(`  Compliance: ${item.complianceStatus} | SNC: ${item.significantNoncompliance}`);
    console.log(`  Penalties: $${item.totalPenalties} | Inspections: ${item.inspectionCount}`);
    if (item.detailedReport) {
        console.log(`  Permits: ${item.detailedReport.permits.length} | Violations: ${item.detailedReport.violations.length}`);
    }
});
```

#### cURL

```bash
## Start the actor
curl -X POST "https://api.apify.com/v2/acts/ryanclinton~epa-echo-search/runs?token=YOUR_APIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "TX",
    "naicsCode": "324",
    "complianceStatus": "3",
    "maxResults": 100
  }'

## Retrieve results (use the defaultDatasetId from the run response)
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_APIFY_API_TOKEN&format=json"
```

#### Apify integrations

EPA ECHO Environmental Compliance Search works with all Apify platform integrations:

- **Google Sheets** -- Automatically export facility compliance data to a spreadsheet for team review and filtering.
- **Slack / Email** -- Get instant notifications when new violations or enforcement actions match your monitoring criteria.
- **Webhooks** -- Push results to your compliance management system, risk platform, or custom data pipeline.
- **Zapier / Make** -- Connect to thousands of apps for custom automation workflows.
- **API access** -- Retrieve results programmatically via the Apify API in JSON, CSV, Excel, XML, or RSS formats.

### Related actors

| Actor | Description | Use together |
|-------|-------------|--------------|
| [OSHA Inspection & Citation Search](https://apify.com/ryanclinton/osha-inspection-search) | Workplace safety inspections and violation citations | Combine environmental compliance with workplace safety for a comprehensive facility risk profile |
| [CFPB Consumer Complaints](https://apify.com/ryanclinton/cfpb-consumer-complaints) | Consumer financial complaints database | Build multi-agency regulatory profiles for large corporations across environmental and financial compliance |
| [SAM.gov Contract Monitor](https://apify.com/ryanclinton/sam-gov-contract-monitor) | Federal contract opportunities and awards | Screen federal contractors for environmental compliance before awarding government work |
| [Federal Register Search](https://apify.com/ryanclinton/federal-register-search) | Federal rulemaking and proposed regulations | Track proposed EPA rules and regulatory changes that may affect facility compliance requirements |
| [Data.gov Dataset Search](https://apify.com/ryanclinton/datagov-dataset-search) | Federal open data catalog | Discover related EPA and environmental datasets for deeper analysis |
| [FEMA Disaster Declaration Search](https://apify.com/ryanclinton/fema-disaster-search) | Disaster declarations and emergency management | Assess environmental facility exposure to natural disasters in disaster-prone areas |
| [OpenAQ Air Quality](https://apify.com/ryanclinton/openaq-air-quality) | Real-time air quality monitoring data | Correlate facility emissions compliance with ambient air quality measurements near regulated facilities |
| [NOAA Weather Alert Monitor](https://apify.com/ryanclinton/noaa-weather-alerts) | Severe weather alerts and warnings | Monitor weather events near regulated facilities that may cause accidental releases or compliance disruptions |
| [USGS Earthquake Search](https://apify.com/ryanclinton/usgs-earthquake-search) | Seismic activity data | Assess seismic risk for facilities handling hazardous materials under RCRA or RMP programs |
| [NVD CVE Vulnerability Search](https://apify.com/ryanclinton/nvd-cve-vulnerability-search) | Cybersecurity vulnerability database | Combine environmental operational risk with cyber risk for comprehensive industrial facility assessments |

# Actor input Schema

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

Search by facility name (partial match). Examples: 'EXXON', 'DOW CHEMICAL', 'TYSON'

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

Filter by U.S. state (2-letter code). Examples: 'TX', 'CA', 'OH'. Comma-separate for multiple: 'TX,CA'

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

Filter by city name. Examples: 'HOUSTON', 'LOS ANGELES'

## `zipCode` (type: `string`):

Filter by 5-digit ZIP code. Comma-separate for multiple: '77001,77002'

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

Filter by county name (use with State for best results)

## `epaRegion` (type: `string`):

Filter by EPA region number (01-10)

## `naicsCode` (type: `string`):

Filter by NAICS code prefix (2-6 digits). Examples: '324' (Petroleum/Coal Mfg), '562' (Waste Management), '221' (Utilities)

## `sicCode` (type: `string`):

Filter by SIC code prefix (2-4 digits). Examples: '29' (Petroleum Refining), '49' (Electric/Gas/Sanitary)

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

Filter by environmental program/media type

## `complianceStatus` (type: `string`):

Filter by compliance status

## `penaltyFilter` (type: `string`):

Filter by penalty history

## `majorFacility` (type: `string`):

Filter by major/minor facility status

## `federalFacility` (type: `boolean`):

Only show federal government facilities

## `formalEnforcement` (type: `boolean`):

Only show facilities with formal enforcement actions in the last 5 years

## `inspectionFilter` (type: `string`):

Filter by inspection history

## `inspectionYears` (type: `integer`):

Number of years for inspection filter (1-5). Only used when Inspection History is 'Within' or 'Not Within'

## `includeDetailedReport` (type: `boolean`):

Fetch the Detailed Facility Report (DFR) for each facility — includes permits, enforcement actions, inspections, and violations. Makes one extra API call per facility.

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

Maximum number of facility records to return (1-10,000)

## Actor input object example

```json
{
  "state": "TX",
  "federalFacility": false,
  "formalEnforcement": false,
  "inspectionYears": 3,
  "includeDetailedReport": false,
  "maxResults": 100
}
```

# 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 = {
    "state": "TX"
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ryanclinton/epa-echo-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "EPA ECHO Environmental Compliance Search",
        "description": "EPA ECHO Environmental Compliance Search is an Apify actor that queries the U.S. Environmental Protection Agency's Enforcement and Compliance History Online (ECHO) database for facility-level environmental compliance data.",
        "version": "0.1",
        "x-build-id": "VVdsDBjwm6Y8oAwDR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ryanclinton~epa-echo-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ryanclinton-epa-echo-search",
                "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/ryanclinton~epa-echo-search/runs": {
            "post": {
                "operationId": "runs-sync-ryanclinton-epa-echo-search",
                "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/ryanclinton~epa-echo-search/run-sync": {
            "post": {
                "operationId": "run-sync-ryanclinton-epa-echo-search",
                "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": {
                    "facilityName": {
                        "title": "Facility Name",
                        "type": "string",
                        "description": "Search by facility name (partial match). Examples: 'EXXON', 'DOW CHEMICAL', 'TYSON'"
                    },
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Filter by U.S. state (2-letter code). Examples: 'TX', 'CA', 'OH'. Comma-separate for multiple: 'TX,CA'"
                    },
                    "city": {
                        "title": "City",
                        "type": "string",
                        "description": "Filter by city name. Examples: 'HOUSTON', 'LOS ANGELES'"
                    },
                    "zipCode": {
                        "title": "ZIP Code",
                        "type": "string",
                        "description": "Filter by 5-digit ZIP code. Comma-separate for multiple: '77001,77002'"
                    },
                    "county": {
                        "title": "County",
                        "type": "string",
                        "description": "Filter by county name (use with State for best results)"
                    },
                    "epaRegion": {
                        "title": "EPA Region",
                        "enum": [
                            "",
                            "01",
                            "02",
                            "03",
                            "04",
                            "05",
                            "06",
                            "07",
                            "08",
                            "09",
                            "10"
                        ],
                        "type": "string",
                        "description": "Filter by EPA region number (01-10)"
                    },
                    "naicsCode": {
                        "title": "NAICS Industry Code",
                        "type": "string",
                        "description": "Filter by NAICS code prefix (2-6 digits). Examples: '324' (Petroleum/Coal Mfg), '562' (Waste Management), '221' (Utilities)"
                    },
                    "sicCode": {
                        "title": "SIC Industry Code",
                        "type": "string",
                        "description": "Filter by SIC code prefix (2-4 digits). Examples: '29' (Petroleum Refining), '49' (Electric/Gas/Sanitary)"
                    },
                    "program": {
                        "title": "Environmental Program",
                        "enum": [
                            "",
                            "A",
                            "W",
                            "R",
                            "S",
                            "T",
                            "G",
                            "M",
                            "ALL"
                        ],
                        "type": "string",
                        "description": "Filter by environmental program/media type"
                    },
                    "complianceStatus": {
                        "title": "Compliance Status",
                        "enum": [
                            "",
                            "2",
                            "3",
                            "4"
                        ],
                        "type": "string",
                        "description": "Filter by compliance status"
                    },
                    "penaltyFilter": {
                        "title": "Penalty Filter",
                        "enum": [
                            "",
                            "ANY",
                            "NEVER",
                            "LE12",
                            "GT12",
                            "LE24",
                            "GT24"
                        ],
                        "type": "string",
                        "description": "Filter by penalty history"
                    },
                    "majorFacility": {
                        "title": "Major Facility",
                        "enum": [
                            "",
                            "Y",
                            "N"
                        ],
                        "type": "string",
                        "description": "Filter by major/minor facility status"
                    },
                    "federalFacility": {
                        "title": "Federal Facility Only",
                        "type": "boolean",
                        "description": "Only show federal government facilities",
                        "default": false
                    },
                    "formalEnforcement": {
                        "title": "Formal Enforcement (5yr)",
                        "type": "boolean",
                        "description": "Only show facilities with formal enforcement actions in the last 5 years",
                        "default": false
                    },
                    "inspectionFilter": {
                        "title": "Inspection History",
                        "enum": [
                            "",
                            "W",
                            "N",
                            "NV"
                        ],
                        "type": "string",
                        "description": "Filter by inspection history"
                    },
                    "inspectionYears": {
                        "title": "Inspection Years",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Number of years for inspection filter (1-5). Only used when Inspection History is 'Within' or 'Not Within'",
                        "default": 3
                    },
                    "includeDetailedReport": {
                        "title": "Include Detailed Report",
                        "type": "boolean",
                        "description": "Fetch the Detailed Facility Report (DFR) for each facility — includes permits, enforcement actions, inspections, and violations. Makes one extra API call per facility.",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of facility records to return (1-10,000)",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
