echo_search_facilities
Search EPA-regulated facilities by US state to screen environmental compliance and enforcement history, including violations, inspections, and penalties. Filter by industry code or facility name.
Instructions
Search EPA-regulated facilities by US state (+ optional sic / facilityName / majorOnly / federalOnly) with compliance/enforcement screening fields (EPA ECHO, keyless) — the NEW facility environmental compliance-risk / due-diligence axis (CAA/CWA/RCRA/SDWA violation, inspection, penalty, SNC history). Input state (REQUIRED enum — the SSRF + silent-zero guard), sic (2–4 digits, a REAL filter), naics (2–6 digits, BEST-EFFORT — ECHO DROPS it upstream, reported in _meta.filtersDropped + a note), facilityName (substring; a typo silently returns 0), majorOnly/federalOnly (bool), limit (≤1000, def 100), offset (multiple of limit). Returns { state, facilities:[…verbatim rows incl. RegistryID…], summary:{ queryRows, programCounts, totalPenalties } } + honest _meta. HONESTY: totalAvailable = the EXACT QueryRows total (NEVER the page size); a hidden two-step QueryID pagination fetches the rows (the QueryID is ephemeral/globally-recycled, never exposed); genuine-empty ⇒ complete:true/total:0; a queryset-limit overflow / bad query ⇒ invalid_input; an outage/5xx ⇒ THROWS (never a fake empty). Feed a row's RegistryID to echo_facility_report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sic | No | Industry filter (2–4 digit SIC code). A REAL filter — ECHO narrows by SIC (live-verified). A code with no facilities returns 0 (silent-zero — verify the code). | |
| limit | No | Facilities per page (→ responseset), 1..1000, default 100. | |
| naics | No | BEST-EFFORT industry filter (2–6 digit NAICS). WARNING: ECHO DROPS the NAICS filter upstream (live-verified 2026-07-12) — the returned facilities are NOT guaranteed to match this code; it is reported in _meta.filtersDropped + a note. Use `sic` (which DOES narrow) to scope by industry. | |
| state | Yes | US state / territory 2-letter code to scope the search (REQUIRED — an unscoped national query is ~5.6M rows; the enum is also the SSRF value guard + the silent-zero guard). e.g. 'DC', 'TX', 'CA', 'PR'. | |
| offset | No | 0-based offset for pagination, default 0. MUST be an exact multiple of `limit` (ECHO pages on fixed boundaries; a non-multiple ⇒ invalid_input). | |
| majorOnly | No | true ⇒ only EPA 'major' facilities (p_maj=Y). | |
| federalOnly | No | true ⇒ only federal facilities (p_ff=Y). | |
| facilityName | No | Facility-name substring filter (p_fn). NOTE: not validated by ECHO — a typo silently returns 0 results, not an error. |