# US EPA TRI Facility ID Portfolio Status Monitor (`plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor`) Actor

Watch TRI Facility IDs and emit typed APPEARED/DROPPED/NAME\_CHANGED/PARENT\_CHANGED/ADDRESS\_CHANGED events from the official EPA Envirofacts tri\_facility JSON API. Not ECHO compliance/violation scrape; not statewide TRI dump; not unpaid ESG SaaS.

- **URL**: https://apify.com/plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor.md
- **Developed by:** [Daniel Witney](https://apify.com/plym-actor-factory) (community)
- **Categories:** AI, Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 tri facility status event delivereds

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US EPA TRI Facility ID Portfolio Status Monitor

Watch a book of **TRI Facility IDs** and emit typed identity events when the official **EPA Envirofacts `tri_facility`** table shows a facility **appearing**, **disappearing**, or changing **name / parent / address**.

**Not** an ECHO compliance / violation / enforcement scrape. **Not** a statewide TRI dump billed as rows. **Not** unpaid ESG SaaS scrape.

### Coverage honesty (TRI facility registry vs ECHO)

This product reads the **TRI reporting-universe facility registry** (`tri_facility` on Envirofacts). It is **facility identity** monitoring (presence, name, parent company, address) — **not** ECHO violation, inspection, or enforcement coverage. Absence from `tri_facility` is **not** proof of every environmental permit status. Cadence follows EPA Envirofacts publish (not streaming). Default product fields: `tri_facility_id` + facility name + address + parent fields (facility/org data).

### Events

| Event | When |
|-------|------|
| `TRI_FACILITY_APPEARED` | Watched ID missing → present on `tri_facility` |
| `TRI_FACILITY_DROPPED` | Watched ID present → missing on `tri_facility` |
| `TRI_FACILITY_NAME_CHANGED` | `facility_name` changed while still present |
| `TRI_PARENT_CHANGED` | Parent company name / D\&B / standardized parent fingerprint changed |
| `TRI_ADDRESS_CHANGED` | Street / city / state / ZIP fingerprint changed |
| `RUN_STATUS` | Non-billable health row every successful run |

First observation of a TRI Facility ID stores a **baseline only** (no product charge).

### Modes

- **`sourceMode=fixture`** (default): Store health / CI. With `emitFixtureDemoEvents=false` (default) emits **only** `RUN_STATUS` / `FIXTURE_HEALTH` → **0** product charges.
- **`sourceMode=live`**: Official EPA Envirofacts lookup-by-id `…/tri_facility/tri_facility_id/{id}/JSON` (**no API key**). Portfolio-safe — does **not** dump statewide TRI rows by default.

### Pricing (Model A)

| Event | Price |
|-------|-------|
| `tri-facility-status-event-delivered` | **$0.02** ($20 / 1k) |
| `apify-actor-start` | **$0.00005** |

Quiet books ≈ $0 product charge. Single tier only (ADR 0010).

### Input

See `.actor/input_schema.json`. Primary field: `triFacilityIds` (durable EPA TRI Facility IDs). Optional `signalGroups`: `presence`, `name`, `parent`, `address`.

### Legal

**GREEN** — EPA Envirofacts public Data Service API. Cite EPA TRI + retrieval date. README honesty: TRI facility registry identity, not ECHO violations.

### A1b wedge

TRI Facility ID watchlist × scheduled Envirofacts `tri_facility` snapshot diff → typed appearance/drop/identity events only for the book. Existing Store shelf is TRI dumps/screeners + ECHO compliance scrapers (wrong job). See `opportunity/reports/phase3-a1b-next3-v11.md` (#3 PASS / GO #31).

Competitors cited from v11 only: `jungle_synthesizer/epa-tri-crawler`, `crawlerbros/epa-envirofacts-scraper`, `chimerical_quicklime/epa-tri-facilities-scraper`, `malonestar` radius rollup, `zentrafoundry` broken snapshot, `pink_comic` ECHO scrapers — none are quiet TRI-ID portfolio PPE.

# Actor input Schema

## `triFacilityIds` (type: `array`):

EPA TRI Facility IDs (durable tri\_facility\_id keys, e.g. 00602BXTRF111CO) to monitor against the official Envirofacts tri\_facility table. Invalid entries are skipped with no charge. Not a statewide dump — only IDs on the book are evaluated.

## `facilityIds` (type: `array`):

Alias for triFacilityIds.

## `signalGroups` (type: `array`):

Which change groups to evaluate: presence (APPEARED/DROPPED), name (NAME\_CHANGED), parent (PARENT\_CHANGED), address (ADDRESS\_CHANGED). Default: all.

## `maxRunSeconds` (type: `integer`):

Wall-clock budget for the run (API lookups + watchlist diff).

## `maxEvents` (type: `integer`):

Stop after this many unique change events are delivered (does not include RUN\_STATUS).

## `resumeFromCheckpoint` (type: `boolean`):

If true, resume facility snapshots and seen event\_uids from the default Key-Value Store.

## `sourceMode` (type: `string`):

fixture = local/CI / Apify Store daily auto-test default (no network; emits RUN\_STATUS only unless emitFixtureDemoEvents=true). live = official EPA Envirofacts tri\_facility JSON API (no API key). Not ECHO HTML/compliance scrape; not statewide TRI dump; not unpaid ESG SaaS.

## `emitFixtureDemoEvents` (type: `boolean`):

When sourceMode=fixture, if true push fabricated change events from local fixtures (unit/local demos only). Default false so Store daily auto-tests never emit fake TRI events or charge tri-facility-status-event-delivered. Production: leave false and use sourceMode=live. SAMPLE rows only: demo events use placeholder entities (never real companies/IDs), are flagged sample=true / isSample=true, and are NEVER charged.

## `asOfHint` (type: `string`):

Optional as\_of label for events / RUN\_STATUS (retrieval date).

## `maxTotalChargeUsd` (type: `number`):

Optional soft budget hint for delivered change events. Platform ACTOR\_MAX\_TOTAL\_CHARGE\_USD also applies when set.

## `envirofactsBaseUrl` (type: `string`):

Optional override for the official EPA Envirofacts tri\_facility service root. Default: https://data.epa.gov/efservice/tri\_facility

## Actor input object example

```json
{
  "triFacilityIds": [
    "00602BXTRF111CO",
    "00602BXTRHRD115"
  ],
  "signalGroups": [
    "presence",
    "name",
    "parent",
    "address"
  ],
  "maxRunSeconds": 55,
  "maxEvents": 500,
  "resumeFromCheckpoint": true,
  "sourceMode": "fixture",
  "emitFixtureDemoEvents": false
}
```

# Actor output Schema

## `OUTPUT` (type: `string`):

JSON summary: delivered, charged, runStatus, checkpoint, stats, TRI facility registry coverage limits

# 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("plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor").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("plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor").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 plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plym-actor-factory/us-epa-tri-facility-portfolio-status-monitor"
        }
    }
}
```

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/WEly91xcYQmoNSWbQ/builds/fx0hZ1GsZ5SmCE5r5/openapi.json
