Skip to content

Latest commit

 

History

History
 
 

airquality

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Provided by: Kristina Robinson

Air Quality (Ozone and Small Particulates per Million) by zipcode from the U.S. EPA AirNow.gov API.

Quick Install

InfluxDB UI

In the InfluxDB UI, go to Settings-> Templates and enter this URL: http://raw.githubusercontent.com/influxdata/community-templates/master/airquality/airquality.yml

Influx CLI

If you have your InfluxDB credentials configured in teh CLI, you can install this template with: influx apply -u https://raw.githubusercontent.com/influxdata/community-templates/master/airquality/airquality.yml

Included Resources

  • 1 Bucket: airquality, 30 day retention (or you may use your own bucket)
  • 1 Label: airquality
  • 1 Telegraf Configuration airquality-telegraf-config
  • 1 Dashboard: Air Quality
  • 1 Variable: bucket (allows any bucket to be used)

Setup Instructions

Go to https://docs.airnowapi.org/account/request/ to request account access. Go to https://docs.airnowapi.org/forecastsbyzip/query, and build your URL as follows:

  • Enter the zip code of interest
  • Select application/json from the Format dropdown
  • Click Build
  • Copy the URL string.
  • Create an environment variable call INFLUX_AIRQUAL_URL and use the copied URL string, but remove the date parameter (this allows the call to always retrieve the current date).

Example URL String:

"https://www.airnowapi.org/aq/forecast/zipCode/?format=application/json&zipCode=99999&distance=25&API_KEY=A1B2C3D4-A1B2-A1B2-A1B1-A1B2C3D4E5F6"

Telegraf Configuration requires the following environment variables:

INFLUX_TOKEN - The token with the permissions to read Telegraf configs and write data to the telegraf bucket. You can just use your operator token to get started. INFLUX_ORG - The name of your Organization INFLUX_HOST - The url of the cloud instance where InfluxDB runs INFLUX_BUCKET - The name of the bucket to put data into. Default is airquality. INFLUX_AIRQUAL_URL - The constructed URL to call the airnow API. Instructions above. You MUST set these environment variables before running Telegraf using something similar to the following commands

Start Telegraf on your local machine with the instructions provided from the Setup Instructions popup (click Data, Telegraf, Setup Instructions).

Contact

Author: Kristina Robinson

Email: kristina@influxdata.com

GitHub: @kristinarobinson

Slack: @Kristina Robinson