# EPA ECHO Facility Compliance Evidence (`civicdataforge/epa-echo-facility-compliance`) Actor

Look up an exact EPA FRS ID or bounded facility query and receive EPA-published compliance, inspection, and enforcement evidence with source hashes and reproducible receipts. Environmental safety remains UNKNOWN.

- **URL**: https://apify.com/civicdataforge/epa-echo-facility-compliance.md
- **Developed by:** [Bryan](https://apify.com/civicdataforge) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Compliance Evidence

An audit-oriented evidence product for one buyer job:

> Given a facility name, bounded address, or exact 12-digit EPA FRS Registry ID, return the EPA-published facility identity, current compliance status fields, inspection/enforcement summaries, and a verifiable retrieval receipt.

### What it does

- Queries the official, public [EPA ECHO Web Services](https://echo.epa.gov/tools/web-services).
- Uses the ECHO Combined Facility Search for the bounded identity lookup.
- For one resolved facility, optionally retrieves official Detailed Facility Report compliance, inspection, and enforcement summaries.
- Preserves the exact published status text. It does not relabel “No Violation Identified” as safe, legally compliant, permitted, or risk-free.
- Emits a stable material-record fingerprint, source-response hashes, observed-schema fingerprint, query receipt, and a universal CivicDataForge decision envelope.
- Accepts a bounded portfolio of up to 10 facilities, emits change classifications against prior fingerprints/decisions, preserves caller-asserted review disposition without overwriting evidence, and binds every row into one batch receipt.
- Caps candidate retrieval at 10. Broad or truncated queries become `SCOPE_INCOMPLETE`; ambiguous candidates become `REVIEW_REQUIRED`.

### Decision semantics

| Decision | Meaning |
|---|---|
| `EVIDENCE_FOUND` | An exact FRS ID or exact published name resolved to one EPA facility and the requested official evidence was retrieved. |
| `NO_PUBLISHED_MATCH` | The complete selected EPA query returned no facility. This is not proof of nonexistence or absence from another authority. |
| `REVIEW_REQUIRED` | The selector is ambiguous or a discovery query produced a candidate that was not exact enough to attribute automatically. |
| `SOURCE_UNAVAILABLE` | The primary EPA source could not be evaluated. No match/no-match conclusion is supported. |
| `SCOPE_INCOMPLETE` | Candidate results were bounded/truncated or a requested DFR detail service was unavailable. |

`environmental_safety_verdict` is always `UNKNOWN`. ECHO evidence is not an environmental-safety, legal-compliance, permit-validity, exposure, liability, or eligibility verdict.

### Inputs

Strongest path:

```json
{
  "facilityId": "110000367567",
  "maxCandidates": 1,
  "includeProgramDetails": true
}
```

Exact-name discovery:

```json
{
  "facilityName": "3M CHEMICAL OPERATIONS' DECATUR FACILITY",
  "nameMatchMode": "exact",
  "city": "Decatur",
  "state": "AL",
  "maxCandidates": 5
}
```

Address-only lookups require city, state, or ZIP. Contains/begins name searches never auto-resolve identity even if the source happens to return one row.

Bounded portfolio refresh:

```json
{
  "batchReference": "industrial-portfolio-2026-08-23",
  "queries": [
    {
      "facilityId": "110000367567",
      "previousRecordFingerprint": "sha256:...",
      "previousDecision": "EVIDENCE_FOUND",
      "previousDecisionReceiptHash": "sha256:...",
      "reviewDisposition": "CONFIRMED_FOR_FOLLOW_UP",
      "reviewReference": "site-case-42"
    }
  ],
  "includeProgramDetails": true
}
```

The Actor intentionally limits a batch to 10 bounded queries and processes them without retaining a customer portfolio. Schedule repeated runs and store prior receipts in your own controlled workflow. A supplied review disposition is explicitly marked `CALLER_ASSERTED` and never converts EPA evidence into a safety or legal conclusion.

### Output and evidence

Each run produces one dataset item containing:

- normalized facility identity and direct EPA Detailed Facility Report URL;
- exact facility/statute compliance status strings published by EPA;
- official program-level compliance, inspection, and enforcement summaries when requested;
- source URLs, timestamps, response hashes, observed-schema fingerprint, query counts, and per-source status;
- record and decision receipt hashes;
- observation-change, caller review, workflow-receipt, and batch-receipt fields;
- responsible semantics and prohibited inferences.

EPA notes that ECHO aggregates multiple federal and state program systems. Reporting schedules and data quality vary, and apparent violations may be alleged or not finally adjudicated. Verify consequential facts in the EPA Detailed Facility Report and the controlling program system. See the official [DFR data dictionary](https://echo.epa.gov/help/reports/dfr-data-dictionary) and [DFR help](https://echo.epa.gov/help/reports/detailed-facility-report-help).

### Tests

```bash
npm test
```

- `test_unit.mjs`: deterministic happy, hostile, failure, ambiguity, truncation, identity, partial-source, and tamper paths.
- `test_bounded.mjs`: bounded live exact-FRS check against all four official EPA endpoints.
- `test_actor_smoke.mjs`: real Actor input-to-dataset execution in isolated local Apify storage.

No API key is required. The Actor is query-only and makes no EPA or external account mutations.

# Actor input Schema

## `queries` (type: `array`):

Optional batch of one to ten bounded facility queries. When present, query-level fields override the shared defaults below.

## `batchReference` (type: `string`):

Optional non-sensitive caller reference bound into the batch receipt.

## `facilityId` (type: `string`):

Exact 12-digit Facility Registry Service ID, for example 110000367567.

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

Published facility name. Add location fields to reduce ambiguity.

## `nameMatchMode` (type: `string`):

Exact is the responsible default. Contains is discovery-only and may require review.

## `streetAddress` (type: `string`):

Full or partial published street address. Address-only searches also require city, state, or ZIP.

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

Single city used to narrow the selected EPA query.

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

Two-letter USPS state or territory code.

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

Five-digit or ZIP+4 code used to narrow the selected EPA query.

## `maxCandidates` (type: `integer`):

Hard response cap. Queries with more matches return SCOPE\_INCOMPLETE instead of implying a complete result.

## `includeProgramDetails` (type: `boolean`):

For one resolved facility, retrieve EPA DFR compliance, inspection, and enforcement summaries.

## `previousRecordFingerprint` (type: `string`):

Optional prior material-record SHA-256 used for single-facility change classification.

## `previousDecision` (type: `string`):

Optional prior bounded decision used only for change classification.

## `previousDecisionReceiptHash` (type: `string`):

Optional prior decision receipt hash bound into change monitoring.

## `reviewDisposition` (type: `string`):

Caller-asserted workflow state. It never changes the EPA evidence decision.

## `reviewReference` (type: `string`):

Optional non-sensitive case reference. Do not submit confidential notes or personal data.

## Actor input object example

```json
{
  "nameMatchMode": "exact",
  "maxCandidates": 5,
  "includeProgramDetails": true,
  "reviewDisposition": "NOT_REVIEWED"
}
```

# Actor output Schema

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

API URL for the default dataset item produced by this run.

# 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 = {};

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

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

```

## MCP server setup

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

```

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/8KrgJjVYCfBmDtdlB/builds/eG1bxlqhLK5ReZhDw/openapi.json
