Access OpenAQ global and open air quality data

R build status rOpenSci peer-review CRAN


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 and see the API documentation at 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.


Install the package with:


Or install the development version:

# install.packages("remotes")

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


If it answers GnuTLS, run

apt-get install libcurl4-openssl-dev

And uninstall then re-install curl.

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