air_quality | R Documentation |
air_quality()
calls the Open-Meteo Air Quality API to obtain pollutant,
pollen, and particulate data. Historical and forecasted data is available.
Refer to the API documentation at: https://open-meteo.com/en/docs/air-quality-api
air_quality(
location,
start = NULL,
end = NULL,
hourly = NULL,
timezone = "auto"
)
location |
Required. The location for which data will be retrieved.
Supplied as either a |
start, end |
Start and end dates in ISO 8601 (e.g. "2020-12-31"). If no dates are supplied, data for the next 5 days will be provided by default. |
hourly |
Required. An air quality variable accepted by the API, or list thereof. See details below. |
timezone |
specify timezone for time data as a string, i.e.
"australia/sydney" (defaults to "auto", the timezone local to the specified
|
You will need to specify at least one air quality variable, such as PM10 or Carbon Monoxide, that you want forecasted data for. These variables are sampled or aggregated at hourly intervals, and can be supplied as a list to request multiple variables over the same time period.
Example hourly air quality variables include:
Variable | Description |
pm10 | Particulate matter smaller than 10 micrometers across |
carbon_monoxide | 10m concentration in micrograms per cubic meter |
european_aqi | European Air Quality Index |
us_aqi | United States Air Quality Index |
dust | Saharan dust particles 10m above ground |
Full documentation for the forecast API is available at: https://open-meteo.com/en/docs/air-quality-api
Requested air quality data for the given location and time, as a tidy tibble.
# obtain Carbon Monoxide levels for Beijing over the next 5 days
air_quality("Beijing", hourly = "carbon_monoxide")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.