OpenAQ

OpenAQ aggregates global air quality data from government agencies, research organizations, and low-cost sensor networks (11,000+ stations). An API key is required — set the OPENAQ_API_KEY environment variable.

MetaData(OpenAQ())
MetaData("OPENAQ_API_KEY", "60 req/min (free tier)", :air_quality, Dict(:pm25 => "PM2.5 (µg/m³)", :pm1 => "PM1 (µg/m³)", :co => "Carbon monoxide (ppm)", :so2 => "Sulfur dioxide (µg/m³)", :bc => "Black carbon (µg/m³)", :pm10 => "PM10 (µg/m³)", :o3 => "Ozone (µg/m³)", :no2 => "Nitrogen dioxide (µg/m³)"), :point, "Station-based", "Global", :timeseries, Hour(1), "Varies by station", "CC BY 4.0", "https://docs.openaq.org/", Dict("DataFrames" => "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"))

Setup

  1. Register at openaq.org to get an API key
  2. Set the environment variable:
ENV["OPENAQ_API_KEY"] = "your-api-key"

Usage

OpenAQ requires sensor IDs via the sensors keyword. Find sensor IDs at explore.openaq.org.

# Daily PM2.5 aggregations for a sensor
plan = DataAccessPlan(OpenAQ(), (-87.6, 41.9),
    Date(2024, 1, 1), Date(2024, 1, 31);
    sensors = [1234],
    frequency = :daily)
files = fetch(plan)

Options

Keyword Type Default Description
sensors Vector{Int} (required) Sensor IDs from OpenAQ Explorer
frequency Symbol :daily :daily or :hourly

Variables

Variable Description
pm25 PM2.5 (µg/m³)
pm10 PM10 (µg/m³)
o3 Ozone (µg/m³)
no2 Nitrogen dioxide (µg/m³)
so2 Sulfur dioxide (µg/m³)
co Carbon monoxide (ppm)
bc Black carbon (µg/m³)
pm1 PM1 (µg/m³)