Package: epair 1.1.0
epair: EPA Data Helper for R
Aid the user in making queries to the EPA API site found at https://aqs.epa.gov/aqsweb/documents/data_api. This package combines API calling methods from various web scraping packages with specific strings to retrieve data from the EPA API. It also contains easy to use loaded variables that help a user navigate services offered by the API and aid the user in determining the appropriate way to make a an API call.
Authors:
epair_1.1.0.tar.gz
epair_1.1.0.zip(r-4.5)epair_1.1.0.zip(r-4.4)epair_1.1.0.zip(r-4.3)
epair_1.1.0.tgz(r-4.5-any)epair_1.1.0.tgz(r-4.4-any)epair_1.1.0.tgz(r-4.3-any)
epair_1.1.0.tar.gz(r-4.5-noble)epair_1.1.0.tar.gz(r-4.4-noble)
epair_1.1.0.tgz(r-4.4-emscripten)epair_1.1.0.tgz(r-4.3-emscripten)
epair.pdf |epair.html✨
epair/json (API)
NEWS
# Install 'epair' in R: |
install.packages('epair', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org')) |
Reviews:rOpenSci Software Review #418
Bug tracker:https://github.com/ropensci/epair/issues
Pkgdown site:https://docs.ropensci.org
- endpoints - Endpoints available in the EPA API
- service.names - Names of services offered by the EPA API
- services - Services offered by the EPA API
- variable.types - Variable parameter names to use
- variables - Variables used for querying in EPA API
Last updated 3 years agofrom:6eedb899c8 (on master). Checks:9 OK. Indexed: yes.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 14 2025 |
R-4.5-win | OK | Mar 14 2025 |
R-4.5-mac | OK | Mar 14 2025 |
R-4.5-linux | OK | Mar 14 2025 |
R-4.4-win | OK | Mar 14 2025 |
R-4.4-mac | OK | Mar 14 2025 |
R-4.4-linux | OK | Mar 14 2025 |
R-4.3-win | OK | Mar 14 2025 |
R-4.3-mac | OK | Mar 14 2025 |
Exports:add.variablesclear.all.cachedclear.cachedcreate.authenticationget_all_masget_all_pqaosget_aqs_keyget_cbsasget_counties_in_stateget_fields_by_serviceget_known_issuesget_monitors_in_bboxget_monitors_in_cbsaget_monitors_in_countyget_monitors_in_siteget_monitors_in_stateget_parameter_classesget_parameters_in_classget_qa_ape_in_agencyget_qa_ape_in_countyget_qa_ape_in_pqaoget_qa_ape_in_siteget_qa_ape_in_stateget_qa_blanks_in_agencyget_qa_blanks_in_countyget_qa_blanks_in_pqaoget_qa_blanks_in_siteget_qa_blanks_in_stateget_qa_ca_in_agencyget_qa_ca_in_countyget_qa_ca_in_pqaoget_qa_ca_in_siteget_qa_ca_in_stateget_qa_fra_in_agencyget_qa_fra_in_countyget_qa_fra_in_pqaoget_qa_fra_in_siteget_qa_fra_in_stateget_qa_frv_in_agencyget_qa_frv_in_countyget_qa_frv_in_pqaoget_qa_frv_in_siteget_qa_frv_in_stateget_qa_pep_in_agencyget_qa_pep_in_countyget_qa_pep_in_pqaoget_qa_pep_in_siteget_qa_pep_in_stateget_qa_qc_in_agencyget_qa_qc_in_countyget_qa_qc_in_pqaoget_qa_qc_in_siteget_qa_qc_in_stateget_revision_historyget_sites_in_countyget_state_fipsget_tf_qa_ape_in_agencyget_tf_qa_ape_in_countyget_tf_qa_ape_in_pqaoget_tf_qa_ape_in_siteget_tf_qa_ape_in_stateget_tf_sample_in_agencyget_tf_sample_in_countyget_tf_sample_in_siteget_tf_sample_in_stateis_API_runninglist.cached.datanon.cached.perform.callperform.callperform.call.rawretrieve.cached.callsave.new.cached.call
Dependencies:askpassclicurldigestgluehttrjsonlitelifecyclemagrittrmimeopensslR.cacheR.methodsS3R.ooR.utilsR6rlangstringistringrsysvctrs
Clarification on terminology
Rendered froma02_ClarificationTerm.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
epair
Rendered fromepair.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-10-23
Started: 2021-07-17
Finding endpoints
Rendered froma08_Endpoints.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
Installation
Rendered froma03_Installation.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
Make a more complex call
Rendered froma06_make-a-more-complex-call.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2022-06-01
Started: 2021-11-28
Making your first call
Rendered froma05_making-your-first-call.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2022-06-01
Started: 2021-11-28
Navigating API Services
Rendered froma09_Services.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
Setup
Rendered froma04_setup.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
Summary
Rendered froma07_wrap-up.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2022-06-01
Started: 2021-11-28
The Anatomy of an EPA API request
Rendered froma01_ananomyEPARequest.Rmd
usingknitr::rmarkdown
on Mar 14 2025.Last update: 2021-11-28
Started: 2021-11-28
Citation
To cite package ‘epair’ in publications use:
Orozco-Mulfinger G, Lawrence M, Gilani O (2025). epair: EPA Data Helper for R. R package version 1.1.0, https://github.com/ropensci/epair.
Corresponding BibTeX entry:
@Manual{, title = {epair: EPA Data Helper for R}, author = {G.L. Orozco-Mulfinger and Madyline Lawrence and Owais Gilani}, year = {2025}, note = {R package version 1.1.0}, url = {https://github.com/ropensci/epair}, }
Readme and manuals
epair
A package designed to aid in getting data from the Environmental Protection Agency (EPA) API at https://aqs.epa.gov/aqsweb/documents/data_api.html.
Overview
The epair
package helps you determine what data you want and how to get that data from the EPA API.
It provides loaded in variables that help you navigate services in the API, and a simple way to query the data.
Broadly, you can explore possible calls by typing epair::get_
and seeing what autocomplete offers in R.
Most of these functions require a start and end date along with a geographical boundary type (like CBSA code or bounding box). For more details, we recommend looking at the help docs ?epair::get_[type]()
for the function you're interested in using to see the exact required params.
Installation
You can download the package simply by using r-universe
.
install.packages("epair", repos = "https://ropensci.r-universe.dev")
Alternativately, you can download the latest release from this repo using devtools
.
devtools::install_github("ropensci/epair")
Or, download these files, and in your working directory run the following.
devtools::install("ropensci/epair")
epair
depends on httr
for making its data calls and rvest
for creating the variables loaded in with the package. We recommend having httr
installed (automatically taken care of through package dependencies), and only installing rvest
if you're curious about how package variables were made.
Usage notes
Note that currently a single call to AQS allows for at maximum a single year's worth of data. You'll need to create separate calls to get multiple year's worth of data.
ropenaq
You may want to check out ropenaq
instead depending on the goals behind your study. ropenaq
is an R wrapper for accessing the OpenAQ API - see its website here. Here are a few differences:
-
epair
will get data from a single source (EPA AQS API), whileropenaq
will be more useful if you’re trying to compare data from different sources. -
If you're interested in data for the US only,
epair
would be an appropriate choice. For more locations across the world,ropenaq
would work better. -
epair’s
data source does offer more granularity than OpenAQ for US data. The EPA AQS API can give over 500 parameters/pollutants of interest (as opposed to OpenAQ’s 5), county level coverage, and unaggregated raw data. By default, OpenAQ will give aggregated data so if you're only interested in aggregations, then OpenAQ is the way to go.
Terms of Service
Make sure you also see the Usage Tips and Terms of Service associated with using this API at https://aqs.epa.gov/aqsweb/documents/data_api.html.