api-ninjas-com Air Quality API

The Air Quality API provides the latest air quality information for any city or geographic location in the world. It provides not only the holistic Air Quality Index (AQI) but also concentrations for major pollutants: Carbon monoxide (CO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), PM2.5 particulates, PM10 particulates.

Operations 1

GET /v1/airquality Get air quality by city or location coordinates #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-air-quality-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-air-quality-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Air Quality API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Air Quality
  description: 'The Air Quality API provides the latest air quality information for any city or geographic location in the world. It provides not only the holistic Air Quality Index (AQI) but also concentrations for major pollutants: Carbon monoxide (CO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), PM2.5 particulates, PM10 particulates.'
paths:
  /v1/airquality:
    get:
      summary: Get air quality by city or location coordinates
      description: Returns the Air Quality Index plus CO, NO2, O3, SO2, PM2.5 and PM10 concentrations for a location. Requires a `city` or `lat`/`lon`; `state` and `country` disambiguate city names. Searching by `city` is premium only; free-tier requests can use `lat`/`lon`.
      operationId: getAirQuality
      parameters:
      - name: lat
        in: query
        description: Latitude of desired location.
        required: false
        schema:
          type: string
      - name: lon
        in: query
        description: Longitude of desired location.
        required: false
        schema:
          type: string
      - name: city
        in: query
        description: City name. Premium only.
        required: false
        schema:
          type: string
      - name: state
        in: query
        description: US state (for United States cities only). Premium only.
        required: false
        schema:
          type: string
      - name: country
        in: query
        description: Country name. Premium only.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful response with air quality data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AirQualityResponse'
        '400':
          description: Bad Request - Invalid parameters or request format.
        '401':
          description: Unauthorized - API key missing or invalid.
        '500':
          description: Internal Server Error - Error on the server side.
      security:
      - ApiKeyAuth: []
      tags:
      - Air Quality
components:
  schemas:
    Pollutant:
      type: object
      properties:
        concentration:
          type: number
          description: Concentration of the pollutant in micrograms per cubic meter.
        aqi:
          type: integer
          description: Air Quality Index for the specific pollutant.
    AirQualityResponse:
      type: object
      properties:
        overall_aqi:
          type: integer
          description: Overall Air Quality Index.
        CO:
          $ref: '#/components/schemas/Pollutant'
        PM10:
          $ref: '#/components/schemas/Pollutant'
        SO2:
          $ref: '#/components/schemas/Pollutant'
        PM2.5:
          $ref: '#/components/schemas/Pollutant'
        O3:
          $ref: '#/components/schemas/Pollutant'
        NO2:
          $ref: '#/components/schemas/Pollutant'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api