# EPA Envirofacts Facilities Scraper (`parseforge/epa-envirofacts-facilities-scraper`) Actor

Scrapes EPA-regulated facility records from seven Envirofacts tables including TRI, RCRA, NPDES, and FRS. Returns each facility as a flat row with registry IDs and location, filterable by state, city, ZIP, and NAICS code.

- **URL**: https://apify.com/parseforge/epa-envirofacts-facilities-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Integrations, Lead generation
- **Stats:** 2 total users, 1 monthly users, 90.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### EPA Envirofacts Facilities Scraper

**Scrape EPA-regulated facility data from Envirofacts by table, state, city, ZIP, or NAICS code, up to a million per run.** Every facility comes with its registry ID, location, and program-specific details. No API key required. Export to CSV, JSON, Excel, or XML.

The EPA's Envirofacts database holds compliance and permit records for every regulated facility in the United States, but its web API returns paginated XML and requires you to learn a separate query language for each program system. This Actor reads facility data directly from seven core Envirofacts tables, including the master FRS registry, TRI toxics, RCRA hazardous waste, and drinking water systems, and returns each match in one flat, consistent schema.
Filter by state, city, ZIP code, or NAICS industry code to pull exactly the facilities you need.

| Who uses it | What they scrape EPA Envirofacts for |
|---|---|
| Environmental consultants | Pull all TRI or RCRA facilities in a state for a Phase I environmental site assessment. |
| Compliance officers | Monitor which facilities in a city hold active NPDES water discharge permits. |
| Data journalists | Download the master FRS registry for a ZIP code to map industrial activity near residential areas. |
| Academic researchers | Collect SDWIS water system data across multiple states for a drinking water quality study. |

### What it does

This Actor collects EPA facility records from a selected Envirofacts table and returns each facility as a flat row with its registry identifiers, location, and program-specific attributes.

- 🏭 **Seven facility tables:** FRS master registry, TRI toxics, RCRA hazardous waste, ICIS Air, NPDES water discharge, SDWIS drinking water, and FRS program linkages.
- 🗺️ **Geographic filters:** narrow results by two-letter state code, city name, or ZIP code before the run starts.
- 🏷️ **Industry filter:** restrict facilities to a single NAICS code so only a specific sector reaches your dataset.
- 📊 **Flat row output:** every facility returns as one row, regardless of which table you query, ready for analysis.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with EPA Envirofacts data

**🗺️ Map regulated facilities in a state.**

An environmental consultant selects the FRS Facility Site table, sets the state filter to 'TX', and downloads every registered facility to overlay on a project map.

**📋 Audit toxic chemical releases by industry.**

A compliance officer queries the TRI Facility table with a NAICS code for chemical manufacturing and a city filter to review local toxic release reports.

**💧 Inventory drinking water systems.**

A public health researcher scrapes the SDWIS Water System table for several ZIP codes to build a dataset of active public water systems and their compliance status.

**🏭 Track hazardous waste handlers.**

A waste management analyst pulls the RCRA Facility table for an entire state to identify active hazardous waste generators and transporters.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Queries the public Envirofacts REST endpoint directly with no registration or token. |
| **Fixed schema** | Every facility from every table returns in one consistent flat structure. |
| **Large pulls** | Collect up to 1,000,000 facilities in a single run with automatic pagination. |
| **Program coverage** | Covers TRI, RCRA, NPDES, ICIS Air, SDWIS, and the master FRS registry. |

### How it compares

No other Store actor targets EPA Envirofacts the same way, so the honest comparison is with the alternatives teams actually weigh.

| | EPA Envirofacts Facilities Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When EPA Envirofacts changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from a selected Envirofacts table and optional state, city, ZIP, and NAICS filters, alone or together, and filters run as each facility is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10
}
```

A larger pull:

```json
{
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0085 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.85 |
| 1,000 results | $8.50 |
| 10,000 results | $85.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [EPA Envirofacts Facilities Scraper](https://apify.com/parseforge/epa-envirofacts-facilities-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to EPA Envirofacts through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/epa-envirofacts-facilities-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that your state code is a valid two-letter USPS abbreviation and that your city name matches the EPA's spelling. Try removing filters one at a time to see which one is too restrictive.

**The run finished but returned fewer facilities than my maxItems setting.**

This is expected when your filters match fewer facilities than the limit you set. The Actor stops when the API returns no more rows. Try broadening your filters or removing them entirely.

**I got an error about an invalid table name.**

Select one of the seven tables from the dropdown in the input editor. The table name must match exactly, including the schema prefix like 'frs.frs\_facility\_site'.

**The dataset columns are different from what I expected.**

Each Envirofacts table returns a different set of columns. Check the EPA's Envirofacts data model documentation for the table you selected to see which fields are available.

**My NAICS code filter is not working.**

Enter the full six-digit NAICS code. Partial codes are not supported by the Envirofacts API. Verify your code against the official NAICS directory at census.gov.

### FAQ

| Question | Answer |
|---|---|
| What is the FRS Facility Site table? | It is the EPA's master Facility Registry Service table. It contains a unique identifier and location for every regulated facility, acting as the central index that links to program-specific tables like TRI and RCRA. |
| Do I need an EPA API key or account? | No. This Actor queries the public Envirofacts REST API, which does not require registration, an API key, or OAuth. |
| Can I filter by state and city at the same time? | Yes. You can combine the state, city, ZIP, and NAICS filters in a single run. The Actor forwards them as URL path parameters to the Envirofacts API. |
| What does the TRI Facility table return? | It returns facilities that report to the Toxics Release Inventory, including their TRI IDs, location, and the parent company name as registered in the TRI program. |
| How many facilities can I collect in one run? | You can set the maximum up to 1,000,000 facilities. The Actor handles pagination automatically until it reaches your limit or exhausts the results. |
| What is a NAICS code and how do I use it? | NAICS is the North American Industry Classification System. Enter a six-digit code in the input to restrict results to facilities in that industry, such as 325199 for organic chemical manufacturing. |
| Which table should I use for water pollution permits? | Use the NPDES Facility table. It returns facilities with National Pollutant Discharge Elimination System permits that regulate point-source water discharges. |
| Can I get RCRA hazardous waste handler data? | Yes. Select the RCRA Facility table to pull hazardous waste generators, transporters, and treatment, storage, and disposal facilities. |
| What export formats are supported? | You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform after the run completes. |
| Does this Actor scrape the EPA website or use the API? | It calls the official Envirofacts REST API directly. It does not scrape the EPA website or parse HTML pages. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by U.S. Environmental Protection Agency. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `table` (type: `string`):

Envirofacts facility table to query.

## `maxItems` (type: `integer`):

How many facilities to collect per run.

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

Optional two-letter US state code to filter facilities (for example CA, TX, NY).

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

Optional city name to filter facilities.

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

Optional ZIP code to filter facilities.

## `naics` (type: `string`):

Optional NAICS industry code to filter facilities.

## Actor input object example

```json
{
  "table": "frs.frs_facility_site",
  "maxItems": 10
}
```

# 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/epa-envirofacts-facilities-scraper").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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/epa-envirofacts-facilities-scraper").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 '{
  "maxItems": 10
}' |
apify call parseforge/epa-envirofacts-facilities-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/epa-envirofacts-facilities-scraper"
        }
    }
}

```

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/FL3akBbktubBeEC5b/builds/76Qgo5pqZ8a8NMjHm/openapi.json
