Search
Unified full-text search across facilities, enforcement cases, and violations. Returns ranked results with text snippets.
Endpoint
/v1/searchFull-text search across all entity types.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
q* | string | Search query texte.g. ACME Chemical Houston |
type | string | Filter results by entity type: facility, case, violation. Default: all types.e.g. facility |
state | string | Narrow results by statee.g. TX |
per_page | integer | Results per page (max 50, default 25) |
qrequiredstringSearch query text
e.g. ACME Chemical HoustontypestringFilter results by entity type: facility, case, violation. Default: all types.
e.g. facilitystatestringNarrow results by state
e.g. TXper_pageintegerResults per page (max 50, default 25)
Example
curl "https://api.parley.dev/v1/search?q=ACME+Chemical&state=TX" \ -H "X-API-Key: prl_YOUR_KEY_HERE"{ "data": [ { "type": "facility", "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "name": "ACME CHEMICAL PLANT", "snippet": "ACME CHEMICAL PLANT, Houston, TX", "score": null, "url": "/v1/facilities/f47ac10b-..." }, { "type": "case", "id": "c9d8e7f6-...", "name": "United States v. ACME Chemical Inc.", "snippet": "CIVIL — SETTLED", "score": null, "url": "/v1/cases/c9d8e7f6-..." }, { "type": "violation", "id": "a1b2c3d4-...", "name": "HPV - Emission Standard Failure", "snippet": "Failure to meet emission standard for volatile organic compounds...", "score": null, "url": "/v1/facilities/f47ac10b-.../violations" } ], "pagination": { "total": 14, "page": 1, "per_page": 25, "has_more": false }}How search works
Ranking
Facility results are ranked using PostgreSQL full-text search (tsvector). Exact name matches and FRS ID matches are prioritized. Cases and violations use case-insensitive text matching and are ordered by recency.
Snippets
The snippet field contains a short text summary of the matched result (e.g., facility name and location, case type and status, or violation description).
Indexed fields
Search indexes facility names and addresses (via full-text search), case names and numbers, and violation types and descriptions. All text matching is case-insensitive.
Filtering by type
Use the type parameter to restrict results to a single entity type:
curl "https://api.parley.dev/v1/search?q=chemical+plant&type=facility" \ -H "X-API-Key: prl_YOUR_KEY_HERE"curl "https://api.parley.dev/v1/search?q=Clean+Air+Act&type=case" \ -H "X-API-Key: prl_YOUR_KEY_HERE"