DailyAQI

For developers

Free, open air-quality data for every city we track.

Air Quality Data API

DailyAQI publishes its computed live AQI as open JSON — free to use with attribution.

Endpoint

A single JSON document lists every city we track with its current reading, updated hourly:

GET https://dailyaqi.com/assets/near.json

Response shape

An array of objects, one per city:

{
  "s": "delhi",              // slug
  "n": "Delhi",              // name
  "r": "Delhi",              // region / country
  "la": 28.70, "lo": 77.17,  // coordinates
  "u": "/air-quality/delhi/",// page URL
  "a": 386,                  // current AQI (null if updating)
  "bn": "Very Poor",         // band name
  "bc": "#E93F33",           // band colour
  "sc": "IN"                 // scale: IN = CPCB, US = US EPA
}

Terms & attribution

Free for non-commercial and commercial use with a visible link back to dailyaqi.com. Underlying data © Central Pollution Control Board (India, via data.gov.in, GODL) and OpenAQ contributors (world). Readings are indicative; see our methodology. No warranty — do not use as the sole basis for health or safety decisions.

Prefer a visual badge?

Use the copy-paste embeddable badge instead of calling the API directly.

DailyAQI publishes its computed live Air Quality Index as free, open JSON, so developers can put real air-quality data into dashboards, displays, bots and research without scraping pages or paying for a feed. This page documents what the air quality API offers, the exact response shape, how to fetch it, sensible use cases, and the terms — everything you need to build with live AQI data responsibly.

What the API offers

The API is intentionally simple: a single JSON document lists every city we track, each with its current reading, updated hourly. There is no key to register, no authentication step and no rate-limit dance for normal use — you fetch one URL and get the whole live picture. Because it is a static, cacheable document served over HTTPS, it is fast, reliable and friendly to client-side code. It is the same data that powers our live map and city pages, computed with the methods described in our methodology, so what you build on it matches what visitors see on the site.

The endpoint

Every tracked city, with its current AQI, lives at one URL:

GET https://dailyaqi.com/assets/near.json

It returns an array of objects, one per city. The document refreshes hourly, so caching your own copy for up to an hour is both polite and sufficient — there is no benefit to requesting it more often than it changes.

Response shape

Each city object uses short keys to keep the payload small:

{
  "s":  "delhi",               // slug (stable id)
  "n":  "Delhi",               // display name
  "r":  "Delhi",               // region / country
  "la": 28.70, "lo": 77.17,    // latitude, longitude
  "u":  "/air-quality/delhi/", // page URL (relative)
  "a":  386,                   // current AQI, or null if updating
  "bn": "Very Poor",           // band / category name
  "bc": "#E93F33",             // band colour (hex)
  "sc": "IN"                   // scale: IN = CPCB, US = US EPA
}

The one field to handle carefully is a: it is null when a city has no fresh reading, which is our honest "data updating" state rather than a stale number. Always check for null before rendering a value.

Fetching the data

Because the document is a plain, CORS-friendly JSON file, you can read it directly from the browser or any server runtime. A minimal browser example:

fetch('https://dailyaqi.com/assets/near.json')
  .then(function (r) { return r.json(); })
  .then(function (cities) {
    var delhi = cities.find(function (c) { return c.s === 'delhi'; });
    if (delhi && delhi.a != null) {
      console.log(delhi.n + ': AQI ' + delhi.a + ' (' + delhi.bn + ')');
    } else {
      console.log('Delhi: data updating');
    }
  });

Or from the command line:

curl -s https://dailyaqi.com/assets/near.json | head

Example use cases

The feed is deliberately general so it can power many things. Understanding what the AQI number means helps you present it well in any of them.

  • Dashboards that show live AQI for a set of cities your users care about.
  • Smart-home and desk displays that colour a light or panel by the local band.
  • Newsroom tickers that surface the most polluted cities during a smog event.
  • Bots and alerts that notify a channel when a city crosses a threshold.
  • Research and teaching, where a simple, documented snapshot is easier to work with than a raw government feed.

Best practices

A few habits keep your integration robust and considerate. Cache the document for up to an hour rather than polling constantly, since it only changes hourly. Always handle the null AQI state gracefully — show "updating," not a blank or a zero. Respect the scale field: an IN city and a US city are on different systems, so compare categories rather than raw numbers when mixing them. And build defensively: treat the feed as indicative data that can occasionally lag, not as a real-time safety instrument.

Terms and attribution

The data is free for both non-commercial and commercial use, on one condition: a visible link back to dailyaqi.com wherever you display it. The underlying measurements are © the Central Pollution Control Board (India, via data.gov.in, under the Government Open Data License – India) and OpenAQ contributors (world); please preserve that lineage when you cite it. Readings are indicative and must not be used as the sole basis for health or safety decisions. We provide the feed as-is, without warranty, and we may adjust the schema over time — build tolerantly.

API or widget?

If you want data to drive your own interface, the API is the right tool. If you simply want to display live air quality on a page without writing code, the copy-paste embeddable widgets are the easier route — they render a finished badge, card, ranking or near-me panel from the same feed, update automatically, and require nothing more than pasting one snippet. Many sites use both: widgets for quick placement, the API for custom views.

Key takeaways

  • One endpoint — /assets/near.json — returns every tracked city's live AQI as JSON, updated hourly, no key required.
  • Handle a: null as "data updating," and respect the sc scale field (CPCB vs US EPA).
  • Cache for up to an hour; the document only changes hourly.
  • Free for any use with a visible link back to dailyaqi.com; underlying data © CPCB and OpenAQ.
  • Readings are indicative, not a safety instrument — prefer the widgets if you only need display.