FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse
stevekrouseeasyAQI_cached
Remix of stevekrouse/easyAQI
Public
Like
easyAQI_cached
Home
Code
2
README.md
S
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

easyAQI

Get the Air Quality Index (AQI) for a location via open data sources.

It's "easy" because it strings together multiple lower-level APIs to give you a simple interface for AQI.

  1. Accepts a location in basically any string format (ie "downtown manhattan")
  2. Uses Nominatim to turn that into longitude and latitude
  3. Finds the closest sensor to you on OpenAQ
  4. Pulls the readings from OpenAQ
  5. Calculates the AQI via EPA's NowCAST algorithm
  6. Uses EPA's ranking to classify the severity of the score (ie "Unhealthy for Sensitive Groups")

Example usage

Create val
@stevekrouse.easyAQI({ location: "brooklyn navy yard" }) // Returns { "aqi": 23.6, "severity": "Good" }

Forkable example: val.town/v/stevekrouse.easyAQIExample

Also useful for getting alerts when the AQI is unhealthy near you: https://www.val.town/v/stevekrouse.aqi

Migrated from folder: Archive/easyAQI_cached

Code
README.md
S
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.