Accesses Air Quality Data from the Open Data Platform OpenAQ


Keywords
air, air-pollution, air-pollution-levels, air-quality, openaq, openaq-api, openaq-data, peer-reviewed, r, r-package, rstats
Licenses
CNRI-Python-GPL-Compatible/CNRI-Python-GPL-Compatible

Documentation

ropenaq

Access OpenAQ global and open air quality data

R build status codecov.io rOpenSci peer-review CRAN

Introduction

This R package is aimed at accessing the OpenAQ API. OpenAQ is a community of scientists, software developers, and lovers of open environmental data who are building an open, real-time database that provides programmatic and historical access to air quality data. See their website at https://openaq.org/ and see the API documentation at https://docs.openaq.org/. The package contains 5 functions that correspond to the 5 different types of query offered by the openaq API: cities, countries, latest, locations and measurements. The package uses the dplyr package: all output tables are tibble objects, that can be further processed and analysed.

Check out this blog post about OpenAQ.

More details about the package can be found in the articles, in particular the introductory articles.

Via the API since November 2017 the API only provides access to the latest 90 days of OpenAQ data. The whole OpenAQ data can be accessed via Amazon S3. See this announcement. You can interact with Amazon S3 using the aws.s3 package and the maintainer of ropenaq plans to write tutorials about how to access OpenAQ data and will also keep the documentation of ropenaq up-to-date regarding data access changes.

Installation

Install the package with:

install.packages("ropenaq")

Or install the development version:

# install.packages("remotes")
remotes::install_github("ropensci/ropenaq")

If you experience trouble using the package on a Linux machine, please run

url::curl_version()$ssl_version

If it answers GnuTLS, run

apt-get install libcurl4-openssl-dev

And uninstall then re-install curl.

install.packages("curl")

If it still doesn't work, please open a new issue!

Meta

  • Please report any issues or bugs.
  • License: GPL
  • Get citation information for ropenaq in R doing citation(package = 'ropenaq')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer