Air Quality Programmatic APIs · API Governance Rules

Air Quality Programmatic APIs API Rules

Spectral linting rules defining API design standards and conventions for Air Quality Programmatic APIs.

10 Rules error 5 warn 5
View Rules File View on GitHub

Rule Categories

info operation parameter response servers token

Rules

warn
info-title-aqicn
API title should start with "Air Quality" or "AQICN"
$.info.title
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation should have tags
$.paths[*][get,post,put,patch,delete]
warn
token-parameter-required
API token query parameter should be documented on all operations
$.paths[*][get,post,put,patch,delete].parameters[?(@.name == 'token')]
error
response-200-required
Operations must define a 200 response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All responses must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
warn
parameter-description-required
All parameters should have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
servers-defined
Servers must be defined
$
warn
servers-https
Server URLs should use HTTPS
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: "spectral:oas"

rules:
  info-title-aqicn:
    description: API title should start with "Air Quality" or "AQICN"
    severity: warn
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "^(Air Quality|AQICN)"

  operation-id-required:
    description: Every operation must have an operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  operation-tags-required:
    description: Every operation should have tags
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  token-parameter-required:
    description: API token query parameter should be documented on all operations
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[?(@.name == 'token')]"
    then:
      field: required
      function: truthy

  response-200-required:
    description: Operations must define a 200 response
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          required: ["200"]

  response-description-required:
    description: All responses must have a description
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses[*]"
    then:
      field: description
      function: truthy

  parameter-description-required:
    description: All parameters should have descriptions
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy

  servers-defined:
    description: Servers must be defined
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy

  servers-https:
    description: Server URLs should use HTTPS
    severity: warn
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"

Work with this as data

Every ruleset 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 spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • 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 ruleset
curl "https://apis.io/api/v1/rules/aqicn-spectral-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?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.