# 🏭 EPA ECHO Enforcement Scraper (`taroyamada/epa-enforcement-digest`) Actor

Extract official environmental compliance records, legal case histories, and penalty fines from the EPA ECHO database for ESG risk models.

- **URL**: https://apify.com/taroyamada/epa-enforcement-digest.md
- **Developed by:** [太郎 山田](https://apify.com/taroyamada) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 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.

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 Enforcement Digest | ECHO Compliance Risk Monitor

Extract comprehensive environmental records and facility details directly from the EPA Enforcement and Compliance History Online (ECHO) database. Designed for data engineers, ESG analysts, and legal tech developers, this scraper provides a highly reliable way to pull structured government data into your own applications. Instead of manually navigating complex federal websites or paying for expensive third-party data feeds, use this tool to programmatically search and collect official enforcement information.

You can easily configure the scraper with specific URLs or keyword search targets to track corporate entities and individual facilities. Schedule the tool to run on a daily or weekly basis to ensure your internal databases, AI models, or ESG platforms are always updated with the latest compliance data. This automated pipeline makes it trivial to monitor new enforcement cases and corporate compliance screeners at scale.

The scraper captures granular, hard-to-parse details directly from the EPA ECHO platform. Every time you run an extraction, the scraped results will include the agency docket number, specific document types, detailed violation severity classifications, exact penalty amounts, and direct links to the original government source. Export your final data in JSON, CSV, or Excel formats to integrate directly with your tools. Whether you are building an environmental risk monitor or a public accountability dashboard, this tool delivers the accurate, timely data you need to drive critical business logic.

### Store Quickstart

- Add one or more `targets[]` entries.
- For facility/company watches, use `facilitySearch` and/or `complianceScreener`.
- For narrow enforcement feeds, use `caseSearch` with a state/region and a date window.
- Keep the same `snapshotKey` across recurring runs so deltas remain comparable.

### Key Features

- 🏛️ **Government-sourced** — Pulls directly from official agency feeds — no third-party aggregators
- ⏱️ **Timely digests** — Daily/weekly rollups of new filings, rulings, or actions
- 🔍 **Keyword watchlists** — Flag items matching your compliance/legal watch terms
- 📊 **Structured metadata** — Agency, date, docket, document type, link — all dataset-ready
- 📡 **Webhook alerts** — Push to legal/compliance teams the moment new items match watchlist

### Use Cases

| Who | Why |
|-----|-----|
| Developers | Automate recurring data fetches without building custom scrapers |
| Data teams | Pipe structured output into analytics warehouses |
| Ops teams | Monitor changes via webhook alerts |
| Product managers | Track competitor/market signals without engineering time |

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| targets | array | prefilled | List of watched facilities, company footprints, or case feeds. Shared target-level selectors (frsId, facilityName, state |
| requestTimeoutSeconds | integer | `30` | Maximum time to wait for one EPA ECHO web-service request. |
| userAgent | string | — | Optional custom User-Agent string for public EPA ECHO requests. |
| delivery | string | `"dataset"` | dataset writes selected target rows to the dataset. webhook posts the digest JSON. email is reserved for a future path. |
| datasetMode | string | `"changes_only"` | Controls which target rows are persisted: action-needed only, changed/initial/partial/error rows, or every row. |
| webhookUrl | string | — | POST destination when delivery=webhook. |
| notifyOnNoChange | boolean | `false` | When true, webhook delivery still fires even when no selected target changed. |
| snapshotKey | string | `"epa-enforcement-digest-snapshots"` | Stable key used to load and save prior ECHO surface snapshots between recurring runs. |

#### Input Example

```json
{
  "targets": [
    {
      "id": "basf-texas",
      "name": "BASF Texas EPA Watch",
      "criticality": "high",
      "owner": "EHS / Compliance",
      "tags": ["chemical", "texas", "epa"],
      "facilityName": "BASF",
      "state": "TX",
      "facilitySearch": {
        "nameMatchMode": "CONTAINS"
      },
      "complianceScreener": {
        "years": 5,
        "activeOnly": true,
        "nameMatchMode": "CONTAINS",
        "evidenceLimit": 5
      }
    },
    {
      "id": "delaware-afr-feed",
      "name": "Delaware Administrative Formal Cases",
      "criticality": "high",
      "owner": "Legal / Compliance",
      "tags": ["case-feed", "delaware", "enforcement"],
      "caseSearch": {
        "state": "DE",
        "caseCategory": "AFR",
        "fromDate": "01/01/2024",
        "toDate": "12/31/2024",
        "evidenceLimit": 5
      }
    }
  ],
  "delivery": "dataset",
  "datasetMode": "changes_only",
  "snapshotKey": "epa-enforcement-example",
  "diffMode": "line_summary",
  "summaryMaxLines": 12,
  "maxEvidenceItems": 5,
  "concurrency": 2,
  "batchDelayMs": 500,
  "dryRun": false
}
````

### Output

| Field | Type | Description |
|-------|------|-------------|
| `meta` | object |  |
| `recurringDigest` | object |  |
| `actionNeeded` | array |  |
| `results` | array |  |
| `actionNeeded[].targetId` | string |  |
| `actionNeeded[].targetName` | string |  |
| `actionNeeded[].owner` | string |  |
| `actionNeeded[].severity` | string |  |
| `actionNeeded[].status` | string |  |
| `actionNeeded[].riskScore` | number |  |
| `actionNeeded[].reason` | string |  |
| `actionNeeded[].signals` | array |  |
| `actionNeeded[].recommendedActions` | array |  |
| `actionNeeded[].executiveSummary` | string |  |

#### Output Example

```json
{
  "meta": {
    "generatedAt": "2026-04-06T11:39:15.914Z",
    "now": "2026-04-05T12:00:00.000Z",
    "input": {
      "targetCount": 1,
      "surfaceCount": 3,
      "delivery": "dataset",
      "datasetMode": "changes_only",
      "diffMode": "line_summary",
      "summaryMaxLines": 10,
      "maxEvidenceItems": 5,
      "concurrency": 2,
      "batchDelayMs": 0,
      "dryRun": false
    },
    "snapshot": {
      "key": "epa-enforcement-local-proof",
      "loadedFrom": "local",
      "savedTo": "local"
    },
    "warnings": [
      "surface(basf-texas-facility-search): fixture data is set; live EPA ECHO requests will be skipped",
      "surface(basf-texas-compliance-screener): fixture data is set; live EPA ECHO requests will be skipped",
      "surface(basf-texas-case-search): fixture data is set; live EPA ECHO requests will be skipped"
    ],
    "totals": {
      "targets": 1,
      "monitoredSurfaces": 3,
      "changedTargets": 1,
      "initialTargets": 0,
      "unchangedTargets": 0,
      "partialTargets": 0,
      "errorTargets": 0,
      "actionNeededTargets": 1,
      "changedSurfaces": 3,
      "initialSurfaces": 0,
      "unchangedSurfaces": 0,
      "errorSurfaces": 0
    },
```

### API Usage

Run this actor programmatically using the Apify API. Replace `YOUR_API_TOKEN` with your token from [Apify Console → Settings → Integrations](https://console.apify.com/account/integrations).

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/taroyamada~epa-enforcement-digest/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "targets": [ { "id": "basf-texas", "name": "BASF Texas EPA Watch", "criticality": "high", "owner": "EHS / Compliance", "tags": ["chemical", "texas", "epa"], "facilityName": "BASF", "state": "TX", "facilitySearch": { "nameMatchMode": "CONTAINS" }, "complianceScreener": { "years": 5, "activeOnly": true, "nameMatchMode": "CONTAINS", "evidenceLimit": 5 } }, { "id": "delaware-afr-feed", "name": "Delaware Administrative Formal Cases", "criticality": "high", "owner": "Legal / Compliance", "tags": ["case-feed", "delaware", "enforcement"], "caseSearch": { "state": "DE", "caseCategory": "AFR", "fromDate": "01/01/2024", "toDate": "12/31/2024", "evidenceLimit": 5 } } ], "delivery": "dataset", "datasetMode": "changes_only", "snapshotKey": "epa-enforcement-example", "diffMode": "line_summary", "summaryMaxLines": 12, "maxEvidenceItems": 5, "concurrency": 2, "batchDelayMs": 500, "dryRun": false }'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("taroyamada/epa-enforcement-digest").call(run_input={
  "targets": [
    {
      "id": "basf-texas",
      "name": "BASF Texas EPA Watch",
      "criticality": "high",
      "owner": "EHS / Compliance",
      "tags": ["chemical", "texas", "epa"],
      "facilityName": "BASF",
      "state": "TX",
      "facilitySearch": {
        "nameMatchMode": "CONTAINS"
      },
      "complianceScreener": {
        "years": 5,
        "activeOnly": true,
        "nameMatchMode": "CONTAINS",
        "evidenceLimit": 5
      }
    },
    {
      "id": "delaware-afr-feed",
      "name": "Delaware Administrative Formal Cases",
      "criticality": "high",
      "owner": "Legal / Compliance",
      "tags": ["case-feed", "delaware", "enforcement"],
      "caseSearch": {
        "state": "DE",
        "caseCategory": "AFR",
        "fromDate": "01/01/2024",
        "toDate": "12/31/2024",
        "evidenceLimit": 5
      }
    }
  ],
  "delivery": "dataset",
  "datasetMode": "changes_only",
  "snapshotKey": "epa-enforcement-example",
  "diffMode": "line_summary",
  "summaryMaxLines": 12,
  "maxEvidenceItems": 5,
  "concurrency": 2,
  "batchDelayMs": 500,
  "dryRun": false
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript / Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('taroyamada/epa-enforcement-digest').call({
  "targets": [
    {
      "id": "basf-texas",
      "name": "BASF Texas EPA Watch",
      "criticality": "high",
      "owner": "EHS / Compliance",
      "tags": ["chemical", "texas", "epa"],
      "facilityName": "BASF",
      "state": "TX",
      "facilitySearch": {
        "nameMatchMode": "CONTAINS"
      },
      "complianceScreener": {
        "years": 5,
        "activeOnly": true,
        "nameMatchMode": "CONTAINS",
        "evidenceLimit": 5
      }
    },
    {
      "id": "delaware-afr-feed",
      "name": "Delaware Administrative Formal Cases",
      "criticality": "high",
      "owner": "Legal / Compliance",
      "tags": ["case-feed", "delaware", "enforcement"],
      "caseSearch": {
        "state": "DE",
        "caseCategory": "AFR",
        "fromDate": "01/01/2024",
        "toDate": "12/31/2024",
        "evidenceLimit": 5
      }
    }
  ],
  "delivery": "dataset",
  "datasetMode": "changes_only",
  "snapshotKey": "epa-enforcement-example",
  "diffMode": "line_summary",
  "summaryMaxLines": 12,
  "maxEvidenceItems": 5,
  "concurrency": 2,
  "batchDelayMs": 500,
  "dryRun": false
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Tips & Limitations

- Run daily for active watchlists; weekly for passive monitoring.
- Webhook delivery works well for compliance team Slack channels — include docket URL for 1-click access.
- Use `watchKeywords` generously — false positives are cheap to triage, false negatives miss filings.
- Pair with `regulatory-change-monitor` for cross-agency coverage.
- Archive Dataset rows weekly for long-term compliance evidence retention.

### FAQ

**How far back does history go?**

This actor monitors forward-only — new items since first run. For historical data, use the agency's own search tool.

**What timezones are used?**

All timestamps are UTC. Use your downstream pipeline to convert to agency-local time if needed.

**Does it translate non-English content?**

No — original language is preserved. Use downstream translation services if needed.

**Is the data official?**

Yes — sourced directly from official government websites and feeds. Not a third-party aggregator.

**Can I use this for legal research?**

For alerting and monitoring, yes. For litigation research, cross-verify with primary sources (agency websites) — this actor is a monitoring tool, not a legal database.

### Related Actors

Government & Regulatory cluster — explore related Apify tools:

- [FDA Warning Letters Digest | Summary-First Feed](https://apify.com/taroyamada/fda-warning-letter-digest) — Monitor public FDA warning letters with one summary-first digest row per configured feed.
- [Federal Register Digest | Agency Rule & Notice Monitor](https://apify.com/taroyamada/federal-register-digest) — Monitor Federal Register documents — rules, proposed rules, and notices — per configured agency feed.
- [Government Contract Award Monitor | Award & Competitor Watch](https://apify.com/taroyamada/government-contract-award-monitor) — Monitor public-sector contract award notices for new wins, notable awardees, incumbent recompetes, and competitor signals — one digest row per configured feed without brittle broad crawling.
- [Grants.gov Funding Digest | Opportunity Watch & Signal Digest](https://apify.com/taroyamada/grants-gov-funding-digest) — Monitor Grants.
- [NHTSA Vehicle Recall Digest | Recalls + Complaints Watch](https://apify.com/taroyamada/nhtsa-vehicle-recall-digest) — Monitor official NHTSA vehicle recall and complaint endpoints for watched model-family, VIN, and manufacturer feeds.
- [Product Safety Recall Digest | CPSC + openFDA Alerts](https://apify.com/taroyamada/product-safety-recall-digest) — Monitor CPSC saferproducts.
- [Regulatory Change Monitor API](https://apify.com/taroyamada/regulatory-change-monitor) — Monitor official regulator update feeds, government bulletin pages, and public compliance notices with one action-oriented digest row per monitored source.
- [OFAC Sanctions Change Digest | SDN List Monitor](https://apify.com/taroyamada/sanctions-change-digest) — Monitor the OFAC SDN (Specially Designated Nationals) sanctions list for additions and removals.
- [Tariff Trade Change Digest | Federal Register + HTS Monitor](https://apify.com/taroyamada/tariff-trade-change-digest) — Monitor U.
- [Treasury Fiscal Data Digest | Debt, Rates & Budget Monitor](https://apify.com/taroyamada/treasury-fiscal-data-digest) — Monitor the U.
- [USPTO Patent Monitor API | JSON + Webhook](https://apify.com/taroyamada/uspto-patent-scraper) — Search and monitor US patent filings with multi-source fallback.
- [Campaign Finance & Lobbying Digest | FEC + LDA Watch](https://apify.com/taroyamada/campaign-finance-lobbying-digest) — Monitor official FEC OpenFEC committee reports and LDA.

### Cost

**Pay Per Event**:

- `actor-start`: $0.01 (flat fee per run)
- `dataset-item`: $0.003 per output item

**Example**: 1,000 items = $0.01 + (1,000 × $0.003) = **$3.01**

No subscription required — you only pay for what you use.

### ⭐ Was this helpful?

If this actor saved you time, please [**leave a ★ rating**](https://apify.com/taroyamada/epa-enforcement-digest/reviews) on Apify Store. It takes 10 seconds, helps other developers discover it, and keeps updates free.

Bug report or feature request? Open an issue on the [Issues tab](https://apify.com/taroyamada/epa-enforcement-digest/issues) of this actor.

# Actor input Schema

## `targets` (type: `array`):

List of watched facilities, company footprints, or case feeds. Shared target-level selectors (frsId, facilityName, state, city, region) are inherited by the individual ECHO surfaces unless overridden.

## `requestTimeoutSeconds` (type: `integer`):

Maximum time to wait for one EPA ECHO web-service request.

## `userAgent` (type: `string`):

Optional custom User-Agent string for public EPA ECHO requests.

## `delivery` (type: `string`):

dataset writes selected target rows to the dataset. webhook posts the digest JSON. email is reserved for a future path.

## `datasetMode` (type: `string`):

Controls which target rows are persisted: action-needed only, changed/initial/partial/error rows, or every row.

## `webhookUrl` (type: `string`):

POST destination when delivery=webhook.

## `notifyOnNoChange` (type: `boolean`):

When true, webhook delivery still fires even when no selected target changed.

## `snapshotKey` (type: `string`):

Stable key used to load and save prior ECHO surface snapshots between recurring runs.

## `diffMode` (type: `string`):

line\_summary keeps compact added/removed snapshot lines. hash\_only only marks changed or unchanged.

## `summaryMaxLines` (type: `integer`):

Maximum added and removed snapshot lines kept per surface.

## `maxEvidenceItems` (type: `integer`):

Upper bound for top facilities/cases retained per surface unless overridden by a surface-level evidenceLimit.

## `concurrency` (type: `integer`):

How many watch targets may be processed in parallel.

## `batchDelayMs` (type: `integer`):

Delay between target batches to soften load on EPA ECHO.

## `dryRun` (type: `boolean`):

If true, the actor skips snapshot writes and remote delivery while still producing local output.

## `nowIso` (type: `string`):

Optional ISO timestamp override for deterministic fixture tests or proof snapshots.

## Actor input object example

```json
{
  "targets": [
    {
      "id": "basf-texas",
      "name": "BASF Texas EPA Watch",
      "criticality": "high",
      "owner": "EHS / Compliance",
      "tags": "chemical,texas,epa",
      "facilityName": "BASF",
      "state": "TX",
      "facilitySearch": {
        "nameMatchMode": "CONTAINS"
      },
      "complianceScreener": {
        "years": 5,
        "activeOnly": true,
        "nameMatchMode": "CONTAINS",
        "evidenceLimit": 5
      }
    }
  ],
  "requestTimeoutSeconds": 30,
  "delivery": "dataset",
  "datasetMode": "changes_only",
  "notifyOnNoChange": false,
  "snapshotKey": "epa-enforcement-digest-snapshots",
  "diffMode": "line_summary",
  "summaryMaxLines": 12,
  "maxEvidenceItems": 5,
  "concurrency": 2,
  "batchDelayMs": 500,
  "dryRun": false
}
```

# 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 = {
    "targets": [
        {
            "id": "basf-texas",
            "name": "BASF Texas EPA Watch",
            "criticality": "high",
            "owner": "EHS / Compliance",
            "tags": "chemical,texas,epa",
            "facilityName": "BASF",
            "state": "TX",
            "facilitySearch": {
                "nameMatchMode": "CONTAINS"
            },
            "complianceScreener": {
                "years": 5,
                "activeOnly": true,
                "nameMatchMode": "CONTAINS",
                "evidenceLimit": 5
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("taroyamada/epa-enforcement-digest").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 = { "targets": [{
            "id": "basf-texas",
            "name": "BASF Texas EPA Watch",
            "criticality": "high",
            "owner": "EHS / Compliance",
            "tags": "chemical,texas,epa",
            "facilityName": "BASF",
            "state": "TX",
            "facilitySearch": { "nameMatchMode": "CONTAINS" },
            "complianceScreener": {
                "years": 5,
                "activeOnly": True,
                "nameMatchMode": "CONTAINS",
                "evidenceLimit": 5,
            },
        }] }

# Run the Actor and wait for it to finish
run = client.actor("taroyamada/epa-enforcement-digest").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 '{
  "targets": [
    {
      "id": "basf-texas",
      "name": "BASF Texas EPA Watch",
      "criticality": "high",
      "owner": "EHS / Compliance",
      "tags": "chemical,texas,epa",
      "facilityName": "BASF",
      "state": "TX",
      "facilitySearch": {
        "nameMatchMode": "CONTAINS"
      },
      "complianceScreener": {
        "years": 5,
        "activeOnly": true,
        "nameMatchMode": "CONTAINS",
        "evidenceLimit": 5
      }
    }
  ]
}' |
apify call taroyamada/epa-enforcement-digest --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🏭 EPA ECHO Enforcement Scraper",
        "description": "Extract official environmental compliance records, legal case histories, and penalty fines from the EPA ECHO database for ESG risk models.",
        "version": "0.1",
        "x-build-id": "Btah1TvpG06BGBJtb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/taroyamada~epa-enforcement-digest/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-taroyamada-epa-enforcement-digest",
                "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/taroyamada~epa-enforcement-digest/runs": {
            "post": {
                "operationId": "runs-sync-taroyamada-epa-enforcement-digest",
                "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/taroyamada~epa-enforcement-digest/run-sync": {
            "post": {
                "operationId": "run-sync-taroyamada-epa-enforcement-digest",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "targets"
                ],
                "properties": {
                    "targets": {
                        "title": "Targets (one digest row each)",
                        "type": "array",
                        "description": "List of watched facilities, company footprints, or case feeds. Shared target-level selectors (frsId, facilityName, state, city, region) are inherited by the individual ECHO surfaces unless overridden.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "title": "Target ID",
                                    "type": "string",
                                    "description": "Stable identifier for snapshots and output rows."
                                },
                                "name": {
                                    "title": "Target name",
                                    "type": "string",
                                    "description": "Human-readable label in the digest output."
                                },
                                "criticality": {
                                    "title": "Criticality",
                                    "type": "string",
                                    "enum": [
                                        "mission_critical",
                                        "high",
                                        "standard",
                                        "low"
                                    ],
                                    "description": "Controls severity escalation and follow-up thresholds."
                                },
                                "owner": {
                                    "title": "Owner",
                                    "type": "string",
                                    "description": "Team or person responsible for follow-up."
                                },
                                "tags": {
                                    "title": "Tags",
                                    "type": "string",
                                    "description": "Comma-separated tags for routing and filtering."
                                },
                                "frsId": {
                                    "title": "Shared FRS ID",
                                    "type": "string",
                                    "description": "Preferred 12-digit FRS identifier for precise facility/company tracking. Shared by facilitySearch/complianceScreener/caseSearch unless overridden."
                                },
                                "facilityName": {
                                    "title": "Shared facility or company name",
                                    "type": "string",
                                    "description": "Facility or company name inherited by facilitySearch/complianceScreener surfaces unless overridden."
                                },
                                "state": {
                                    "title": "Shared state",
                                    "type": "string",
                                    "description": "USPS state code inherited by facilitySearch/complianceScreener/caseSearch unless overridden."
                                },
                                "city": {
                                    "title": "Shared city",
                                    "type": "string",
                                    "description": "City inherited by facilitySearch/caseSearch unless overridden."
                                },
                                "region": {
                                    "title": "Shared EPA region",
                                    "type": "string",
                                    "description": "EPA region inherited by facilitySearch/complianceScreener/caseSearch unless overridden."
                                },
                                "facilitySearch": {
                                    "title": "All-media facility search surface",
                                    "type": "object",
                                    "description": "Optional ECHO all-media facility search surface. Inherits frsId/facilityName/state/city/region from the target unless overridden.",
                                    "properties": {
                                        "id": {
                                            "title": "Surface ID",
                                            "type": "string",
                                            "description": "Optional override identifier for this facility-search surface."
                                        },
                                        "name": {
                                            "title": "Surface name",
                                            "type": "string",
                                            "description": "Optional display label for this facility-search surface."
                                        },
                                        "frsId": {
                                            "title": "FRS ID",
                                            "type": "string",
                                            "description": "Facility Registry Service identifier used for precise facility matching."
                                        },
                                        "facilityName": {
                                            "title": "Facility name",
                                            "type": "string",
                                            "description": "Facility or company name passed to the ECHO all-media facility search."
                                        },
                                        "state": {
                                            "title": "State",
                                            "type": "string",
                                            "description": "USPS state code used for facility filtering."
                                        },
                                        "city": {
                                            "title": "City",
                                            "type": "string",
                                            "description": "City filter used for facility search narrowing."
                                        },
                                        "region": {
                                            "title": "EPA region",
                                            "type": "string",
                                            "description": "EPA region filter used for facility search narrowing."
                                        },
                                        "quickSearch": {
                                            "title": "Quick search term",
                                            "type": "string",
                                            "description": "Optional ECHO quick-search term."
                                        },
                                        "media": {
                                            "title": "Media codes",
                                            "type": "string",
                                            "description": "Comma-separated media codes such as A, C, R, S, T."
                                        },
                                        "nameMatchMode": {
                                            "title": "Name match mode",
                                            "type": "string",
                                            "enum": [
                                                "CONTAINS",
                                                "EXACT",
                                                "BEGINS",
                                                "ALL"
                                            ],
                                            "description": "Facility name search mode when facilityName is used."
                                        },
                                        "majorOnly": {
                                            "title": "Major facilities only",
                                            "type": "boolean",
                                            "description": "Restrict to major facilities only."
                                        },
                                        "evidenceLimit": {
                                            "title": "Facility evidence limit",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 25,
                                            "description": "How many top facility evidence rows to keep."
                                        }
                                    }
                                },
                                "complianceScreener": {
                                    "title": "Corporate compliance screener surface",
                                    "type": "object",
                                    "description": "Optional ECHO compliance screener surface. Good for company footprints or multi-facility facility-name watches.",
                                    "properties": {
                                        "id": {
                                            "title": "Surface ID",
                                            "type": "string",
                                            "description": "Optional override identifier for this compliance-screener surface."
                                        },
                                        "name": {
                                            "title": "Surface name",
                                            "type": "string",
                                            "description": "Optional display label for this compliance-screener surface."
                                        },
                                        "frsId": {
                                            "title": "FRS ID",
                                            "type": "string",
                                            "description": "Facility Registry Service identifier used for precise screener matching."
                                        },
                                        "facilityName": {
                                            "title": "Facility name",
                                            "type": "string",
                                            "description": "Facility or company name passed to the compliance screener."
                                        },
                                        "state": {
                                            "title": "State",
                                            "type": "string",
                                            "description": "USPS state code used for compliance screener narrowing."
                                        },
                                        "region": {
                                            "title": "EPA region",
                                            "type": "string",
                                            "description": "EPA region filter used for compliance screener narrowing."
                                        },
                                        "nameMatchMode": {
                                            "title": "Name match mode",
                                            "type": "string",
                                            "enum": [
                                                "CONTAINS",
                                                "EXACT",
                                                "BEGINS",
                                                "ALL"
                                            ],
                                            "description": "Facility/company name search mode when facilityName is provided."
                                        },
                                        "years": {
                                            "title": "Settlement lookback years",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 10,
                                            "description": "Settlement lookback window used by the screener service."
                                        },
                                        "activeOnly": {
                                            "title": "Active facilities only",
                                            "type": "boolean",
                                            "description": "When true, only active facilities are screened."
                                        },
                                        "evidenceLimit": {
                                            "title": "Screener evidence limit",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 25,
                                            "description": "How many top screener rows to keep from the first page."
                                        }
                                    }
                                },
                                "caseSearch": {
                                    "title": "Enforcement case search surface",
                                    "type": "object",
                                    "description": "Optional EPA enforcement case surface. Best for specific facility IDs or narrow state/region date windows.",
                                    "properties": {
                                        "id": {
                                            "title": "Surface ID",
                                            "type": "string",
                                            "description": "Optional override identifier for this case-search surface."
                                        },
                                        "name": {
                                            "title": "Surface name",
                                            "type": "string",
                                            "description": "Optional display label for this case-search surface."
                                        },
                                        "facilityId": {
                                            "title": "Facility ID",
                                            "type": "string",
                                            "description": "Facility registration identifier or inherited frsId when applicable."
                                        },
                                        "state": {
                                            "title": "State",
                                            "type": "string",
                                            "description": "USPS state code used for enforcement case filtering."
                                        },
                                        "region": {
                                            "title": "EPA region",
                                            "type": "string",
                                            "description": "EPA region filter used for enforcement case searches."
                                        },
                                        "facilityCity": {
                                            "title": "Facility city",
                                            "type": "string",
                                            "description": "Facility city filter used for case narrowing."
                                        },
                                        "facilityZip": {
                                            "title": "Facility ZIP",
                                            "type": "string",
                                            "description": "Facility ZIP/postal code filter used for case narrowing."
                                        },
                                        "caseCategory": {
                                            "title": "Case categories",
                                            "type": "string",
                                            "description": "Comma-separated case categories such as AFR, AIF, JDC."
                                        },
                                        "caseStatus": {
                                            "title": "Case status codes",
                                            "type": "string",
                                            "description": "Comma-separated case status codes."
                                        },
                                        "violationTypes": {
                                            "title": "Violation type codes",
                                            "type": "string",
                                            "description": "Comma-separated case violation codes."
                                        },
                                        "fromDate": {
                                            "title": "From date",
                                            "type": "string",
                                            "description": "Milestone start date. MM/DD/YYYY or ISO accepted."
                                        },
                                        "toDate": {
                                            "title": "To date",
                                            "type": "string",
                                            "description": "Milestone end date. MM/DD/YYYY or ISO accepted."
                                        },
                                        "caseNumber": {
                                            "title": "Case number",
                                            "type": "string",
                                            "description": "Specific case number if known."
                                        },
                                        "caseName": {
                                            "title": "Case name",
                                            "type": "string",
                                            "description": "Case name filter. Requires caseNameType when used."
                                        },
                                        "caseNameType": {
                                            "title": "Case name modifier",
                                            "type": "string",
                                            "description": "Case name modifier accepted by ECHO when caseName is used."
                                        },
                                        "querySet": {
                                            "title": "Query set",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 70000,
                                            "description": "Optional ECHO queryset override for large but still acceptable feeds."
                                        },
                                        "evidenceLimit": {
                                            "title": "Case evidence limit",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 25,
                                            "description": "How many case rows to keep from the first page."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "requestTimeoutSeconds": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Maximum time to wait for one EPA ECHO web-service request.",
                        "default": 30
                    },
                    "userAgent": {
                        "title": "Custom User-Agent",
                        "type": "string",
                        "description": "Optional custom User-Agent string for public EPA ECHO requests."
                    },
                    "delivery": {
                        "title": "Delivery mode",
                        "enum": [
                            "dataset",
                            "webhook",
                            "email"
                        ],
                        "type": "string",
                        "description": "dataset writes selected target rows to the dataset. webhook posts the digest JSON. email is reserved for a future path.",
                        "default": "dataset"
                    },
                    "datasetMode": {
                        "title": "Dataset mode",
                        "enum": [
                            "action_needed",
                            "changes_only",
                            "all"
                        ],
                        "type": "string",
                        "description": "Controls which target rows are persisted: action-needed only, changed/initial/partial/error rows, or every row.",
                        "default": "changes_only"
                    },
                    "webhookUrl": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "POST destination when delivery=webhook."
                    },
                    "notifyOnNoChange": {
                        "title": "Notify even if nothing changed",
                        "type": "boolean",
                        "description": "When true, webhook delivery still fires even when no selected target changed.",
                        "default": false
                    },
                    "snapshotKey": {
                        "title": "Snapshot key",
                        "type": "string",
                        "description": "Stable key used to load and save prior ECHO surface snapshots between recurring runs.",
                        "default": "epa-enforcement-digest-snapshots"
                    },
                    "diffMode": {
                        "title": "Diff mode",
                        "enum": [
                            "line_summary",
                            "hash_only"
                        ],
                        "type": "string",
                        "description": "line_summary keeps compact added/removed snapshot lines. hash_only only marks changed or unchanged.",
                        "default": "line_summary"
                    },
                    "summaryMaxLines": {
                        "title": "Max diff summary lines",
                        "minimum": 5,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum added and removed snapshot lines kept per surface.",
                        "default": 12
                    },
                    "maxEvidenceItems": {
                        "title": "Global evidence limit",
                        "minimum": 1,
                        "maximum": 25,
                        "type": "integer",
                        "description": "Upper bound for top facilities/cases retained per surface unless overridden by a surface-level evidenceLimit.",
                        "default": 5
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many watch targets may be processed in parallel.",
                        "default": 2
                    },
                    "batchDelayMs": {
                        "title": "Inter-batch delay (ms)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Delay between target batches to soften load on EPA ECHO.",
                        "default": 500
                    },
                    "dryRun": {
                        "title": "Dry run",
                        "type": "boolean",
                        "description": "If true, the actor skips snapshot writes and remote delivery while still producing local output.",
                        "default": false
                    },
                    "nowIso": {
                        "title": "Override current time (ISO)",
                        "type": "string",
                        "description": "Optional ISO timestamp override for deterministic fixture tests or proof snapshots."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
