Envirofacts Data Service API
On this page
- About this page
- Overview
- Constructing requests
- Filtering and sorting
- Paging large result sets
- Examples
- Related Envirofacts API tools
- Help and feedback
About this page
This page documents the Envirofacts Data Service API, a RESTful service that provides direct, programmatic access to Envirofacts environmental data tables. This API is designed for table-based queries, filtering, sorting, and paging of results.
For advanced joins across datasets or GraphQL-based access, see the Envirofacts Web Services hub for links to additional APIs.
Overview
The Envirofacts Data Service API allows users to query individual Envirofacts database tables using simple URL-based requests. Responses are returned in machine-readable formats suitable for analysis, integration, and automation.
This API is best suited for:
- Direct access to Envirofacts tables
- Filtering and sorting records
- Paging through large datasets
- Exporting results in multiple formats
Constructing requests
Requests are constructed by specifying a table name followed by optional filters, sorting, paging, and output format.
Base URL pattern:
https://data.epa.gov/efservice/{program}.{table}
Table names follow the format {program}.{table}, where program is the source system (for example, tri, frs, rcrainfo, sems).
Filtering and sorting
Filters are applied using column-based operators appended to the URL. Multiple filters may be combined using logical conjunctions.
Common operators include:
equalsnotEqualsgreaterThan,lessThanbeginsWith,containsin,notIn
Sorting is applied using the /sort/ keyword followed by one or more columns.
Paging large result sets
To manage large result sets, requests must include a paging range using the format:
/{first}:{last}
Paging begins at record 1. For example, 1:1000 returns the first 1,000 records.
Paging is required for large tables to ensure reliable performance and to prevent timeouts.
Examples
Example 1: Filter records by state
Returns facilities located in Virginia:
https://data.epa.gov/efservice/frs.frs_facility/state_code/equals/VA/1:100
Example 2: Sort results
Returns TRI facilities in Texas, sorted by facility name:
https://data.epa.gov/efservice/tri.tri_facility/state/equals/TX/sort/facility_name/1:100
Example 3: Export results as CSV
Returns the first 500 records in CSV format:
https://data.epa.gov/efservice/rcrainfo.handler/1:500/csv
Related Envirofacts API tools
- Envirofacts Web Services
Central hub for Envirofacts APIs and related services. - Envirofacts REST API Viewer
Interactive tool for exploring and testing API requests. - API usage statistics
API call counts by year, month, and program.
Help and feedback
For Envirofacts Data Service API questions or suggestions, please contact the Envirofacts team.