Developer Central Links
Envirofacts Application Programming Interface (API) - Toxics (Table Join)
The Toxics Release Inventory (TRI) contains information about more than 650 toxic chemicals that are being used, manufactured, treated, transported, or released into the environment. Manufacturers of these chemicals are required to report the locations and quantities of chemicals stored on-site to state and local governments. The reports are submitted to the EPA and state governments. This data is publicly available and can be obtained for viewing within Excel, used within an application, or used as part of a Web mash-up. For example, if users are interested in seeing facilities that have submitted information to TRI within the state of Virginia for 2010, they can query the information directly from the database through the Envirofacts Representational State Transfer (RESTful) data service API.
The Uniform Resource Locator (URL) to do this is:
Click here to download the TRI Developer Webinar (.wmv, 12MB)
About the Envirofacts API
Envirofacts has developed a RESTful data service API to all of its internal data holdings. This functionality provides a user of Envirofacts with the ability to query any table through the use of a URL. The default output is in Extensible Markup Language (XML), which can be utilized in other applications, as well as tools such as Microsoft Excel or Access, or used as part of a Web mash-up. Output options of Comma-Separated Values (CSV) and Excel can be requested in the URL. The entire Envirofacts database metadata is available online so that all tables and columns within Envirofacts are documented. Having the table structures available in this manner makes most of Envirofacts data easily available through the service.
Constructing a Search
When the data users want to retrieve is not found in a single table they can create a URL that joins multiple (up to three) tables. To build a search that shows TRI Form R submissions for 2010 for Virginia, join the tri_facility and tri_reporting_form tables: http://iaspub.epa.gov/enviro/efservice/tri_facility/state_abbr/VA/tri_reporting_form/reporting_year/2010/EXCEL
First visit the Envirofacts homepage.
- Click on the "About the Data" tab at the top of the page. From the About the Data page, click on any of the program system names to go to a Program System Search page. In this case, click the "Toxics Release Inventory (TRI)" program link.
The TRI "Search" page will load. The "TRI Links" box on the right hand side of the page provides a link to an "Overview" page that describes the available TRI data and a link to the TRI "Model" page.
Click the "Overview" link to see a description of the TRI data.
Click the "Model" link to see the subject areas for TRI
Click a subject area (for example: FACILITIES IDENTIFICATION) to see to a diagram showing all tables in the subject area and their relationships.
Click a table name (for example: TRI_FACILITY) to go to that table’s metadata page, which has a description of the table and a list of all columns. The TRI_FACILIY table shows "the physical location where toxic chemicals are manufactured, processed, or otherwise used". STATE_ABBR is one of the columns available from this table that will be used to limit results to the state of Virginia.
- The Model also shows links to tables in other subject areas (in this case the TRI_REPORTING_FORM table).
Click this table name to see that table’s metadata page, which has a description of the table and a list of all columns. The TRI_REPORTING_FORM includes "Identifying data of the Toxic Chemical Release Inventory Reporting Form (EPA Form R or Form A, Parts I and II)" and has the REPORTING_YEAR column.
- These tables can be used to build a search that shows TRI Form R submissions for 2010 for Virginia:
The following table shows the breakdown of the components of the TRI Form R submissions for 2010 for Virginia URL: http://iaspub.epa.gov/enviro/efservice/tri_facility/state_abbr/VA/tri_reporting_form/reporting_year/2010/EXCEL