{
  "openapi": "3.0.3",
  "info": {
    "title": "全国城市空气质量查询",
    "description": "提供全国城市空气质量数据，每小时更新。目前支持全国300+城市，可查询监测点数据、实时查询空气质量、小时粒度、实时给出空气质量AQI指数，并给出空气质量级别和首要污染物。广泛应用于交通、环境监测、智能设备、互联网等领域。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/104-42": {
      "x-pointCode": 42,
      "x-mode": "mapping",
      "x-read-timeout": 5,
      "x-connect-timeout": 5,
      "post": {
        "summary": "全国城市空气质量查询",
        "description": "由于国家只发布了370个大城市空气质量，因此查询小地区 返回上一级主要城市的PM25情况。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "so2": {
                              "type": "string",
                              "description": "二氧化硫一小时平均，μg/m³"
                            },
                            "o3": {
                              "type": "string",
                              "description": "臭氧1小时平均，μg/m³"
                            },
                            "pm2_5": {
                              "type": "string",
                              "description": "颗粒物（粒径小于等于2.5μm）1小时平均，μg/m³"
                            },
                            "primary_pollutant": {
                              "type": "string",
                              "description": "首要污染物"
                            },
                            "ct": {
                              "type": "string",
                              "description": "发布时间"
                            },
                            "num": {
                              "type": "string",
                              "description": "排行"
                            },
                            "co": {
                              "type": "string",
                              "description": "一氧化碳1小时平均，mg/m³"
                            },
                            "area": {
                              "type": "string",
                              "description": "地区名"
                            },
                            "no2": {
                              "type": "string",
                              "description": "二氧化氮1小时平均，μg/m³"
                            },
                            "aqi": {
                              "type": "string",
                              "description": "空气质量指数(AQI)，即air quality index，是定量描述空气质量状况的无纲量指数"
                            },
                            "quality": {
                              "type": "string",
                              "description": "空气质量指数类别，有“优质、良好、轻度污染、中度污染、重度污染、严重污染”6类"
                            },
                            "pm10": {
                              "type": "string",
                              "description": "颗粒物（粒径小于等于10μm）1小时平均，μg/m³"
                            },
                            "o3_8h": {
                              "type": "string",
                              "description": "臭氧8小时滑动平均，μg/m³"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其它失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "104_42_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "area": {
                    "type": "string",
                    "description": "由于国家只发布了370个大城市空气质量，因此查询小地区时，系统将返回此地区的上级区域空气质量。"
                  }
                },
                "required": [
                  "area"
                ]
              }
            }
          }
        }
      }
    },
    "/104-41": {
      "x-pointCode": 41,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "全国城市空气质量排行榜",
        "description": "查询全国367个城市的空气质量排行榜",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "aqi": {
                                    "type": "string",
                                    "description": "空气质量指数(AQI)，即air quality index，是定量描述空气质量状况的无纲量指数"
                                  },
                                  "area": {
                                    "type": "string",
                                    "description": "城市名称"
                                  },
                                  "co": {
                                    "type": "string",
                                    "description": "一氧化碳1小时平均，mg/m³"
                                  },
                                  "ct": {
                                    "type": "string",
                                    "description": "发布时间"
                                  },
                                  "no2": {
                                    "type": "string",
                                    "description": "二氧化氮1小时平均，μg/m³"
                                  },
                                  "o3": {
                                    "type": "string",
                                    "description": "臭氧1小时平均，μg/m³"
                                  },
                                  "o3_8h": {
                                    "type": "string",
                                    "description": "臭氧8小时滑动平均，μg/m³"
                                  },
                                  "pm10": {
                                    "type": "string",
                                    "description": "颗粒物（粒径小于等于10μm）1小时平均，μg/m³"
                                  },
                                  "pm2_5": {
                                    "type": "string",
                                    "description": "颗粒物（粒径小于等于2.5μm）1小时平均，μg/m³"
                                  },
                                  "primary_pollutant": {
                                    "type": "string",
                                    "description": "首要污染物"
                                  },
                                  "quality": {
                                    "type": "string",
                                    "description": "空气质量指数类别，有“优质、良好、轻度污染、中度污染、重度污染、严重污染”6类"
                                  },
                                  "so2": {
                                    "type": "string",
                                    "description": "二氧化硫一小时平均，μg/m³"
                                  }
                                }
                              }
                            },
                            "ret_code": {
                              "type": "string",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "104_41_POST",
        "parameters": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/104?tab=book"
  },
  "x-apiCode": "104",
  "x-is-own": false,
  "x-is-op": true
}