MobSDK

空气质量 永久免费 支持HTTPS

提供城市实时和未来几天的空气质量情况。

包括:空气质量,空气质量指数以及污染物(pm2.5,no2,so2)指数等数据。

API

  • 空气质量查询
  • 城市列表查询接口

错误码参照

  • 空气质量查询
  • 城市列表查询接口

价格套餐

  • 空气质量查询
  • 城市列表查询接口

空气质量查询

接口地址:http://apicloud.mob.com/environment/query

支持格式:JSON

请求方式:GET

请求示例:http://apicloud.mob.com/environment/query?key=appkey&city=通州&province=北京

备注说明:提供城市实时和未来几天的空气质量情况。

请求参数:

name type N D value
key string 用户申请的appkey
city string 城市或地区名字
province string 当前城市的所属省份 如:北京-通州、江苏-通州(url编码)

返回字段:

name type N D value
retCode string 返回码
msg string 返回说明
retCode string 返回结果集
aqi int 空气质量指数
city string 城市
district string 区县
no2 int 污染物no2
pm25 int 污染物pm2.5
so2 int 污染物so2
province string 省份
updateTime string 更新时间
quality string 空气质量
fetureData array 未来几天数据
date string 日期
quality string 空气质量
hourData array 空气质量指数小时数据
dateTime string 时间

JSON返回示例:

                            {
    "msg": "success",
    "result": [
        {
            "aqi": 290,
            "city": "合肥",
            "district": "合肥",
            "fetureData": [
                {
                    "aqi": 214,
                    "date": "2015-12-24",
                    "quality": "重度污染"
                },
                {
                    "aqi": 146,
                    "date": "2015-12-25",
                    "quality": "轻度污染"
                },
                {
                    "aqi": 176,
                    "date": "2015-12-26",
                    "quality": "中度污染"
                },
                {
                    "aqi": 173,
                    "date": "2015-12-27",
                    "quality": "中度污染"
                },
                {
                    "aqi": 171,
                    "date": "2015-12-28",
                    "quality": "中度污染"
                },
                {
                    "aqi": 163,
                    "date": "2015-12-29",
                    "quality": "中度污染"
                }
            ],
            "hourData": [
                {
                    "aqi": 217,
                    "dateTime": "2015-12-2314:00:00"
                },
                {
                    "aqi": 250,
                    "dateTime": "2015-12-2313:00:00"
                },
                {
                    "aqi": 273,
                    "dateTime": "2015-12-2312:00:00"
                },
                {
                    "aqi": 275,
                    "dateTime": "2015-12-2311:00:00"
                },
                {
                    "aqi": 285,
                    "dateTime": "2015-12-2310:00:00"
                },
                {
                    "aqi": 328,
                    "dateTime": "2015-12-2309:00:00"
                },
                {
                    "aqi": 348,
                    "dateTime": "2015-12-2308:00:00"
                },
                {
                    "aqi": 355,
                    "dateTime": "2015-12-2307:00:00"
                },
                {
                    "aqi": 356,
                    "dateTime": "2015-12-2306:00:00"
                },
                {
                    "aqi": 354,
                    "dateTime": "2015-12-2305:00:00"
                },
                {
                    "aqi": 348,
                    "dateTime": "2015-12-2304:00:00"
                },
                {
                    "aqi": 321,
                    "dateTime": "2015-12-2303:00:00"
                },
                {
                    "aqi": 300,
                    "dateTime": "2015-12-2302:00:00"
                },
                {
                    "aqi": 316,
                    "dateTime": "2015-12-2301:00:00"
                },
                {
                    "aqi": 342,
                    "dateTime": "2015-12-2300:00:00"
                },
                {
                    "aqi": 373,
                    "dateTime": "2015-12-2223:00:00"
                },
                {
                    "aqi": 399,
                    "dateTime": "2015-12-2222:00:00"
                },
                {
                    "aqi": 394,
                    "dateTime": "2015-12-2221:00:00"
                },
                {
                    "aqi": 401,
                    "dateTime": "2015-12-2220:00:00"
                },
                {
                    "aqi": 382,
                    "dateTime": "2015-12-2219:00:00"
                },
                {
                    "aqi": 357,
                    "dateTime": "2015-12-2218:00:00"
                },
                {
                    "aqi": 331,
                    "dateTime": "2015-12-2217:00:00"
                },
                {
                    "aqi": 332,
                    "dateTime": "2015-12-2216:00:00"
                },
                {
                    "aqi": 330,
                    "dateTime": "2015-12-2215:00:00"
                }
            ],
            "no2": 55,
            "pm25": 167,
            "province": "安徽",
            "quality": "严重污染",
            "so2": 19,
            "updateTime": "2015-12-2315:00:00"
        }
    ],
    "retCode": "200"
}
                        

错误代码:

name type N D value
20701 城市名称参数为空
20702 查询不到该城市的空气质量

价格套餐:

name type N D value
免费套餐 免费 无限次

城市列表查询接口

接口地址:http://apicloud.mob.com/environment/citys

支持格式:JSON

请求方式:GET

请求示例:http://apicloud.mob.com/environment/citys?key=appkey

备注说明:空气质量支持的城市列表。

请求参数:

name type N D value
key string 用户申请的appkey

返回字段:

name type N D value
retCode string 返回码
msg string 返回说明
result string 返回结果集
province string 省份
city string 城市
district string 区县

JSON返回示例:

                            {
    "msg": "success",
    "result": [
        {
            "city": [
                {
                    "city": "北京",
                    "district": [
                        {
                            "district": "北京"
                        },
                        {
                            "district": "平谷"
                        },
                        {
                            "district": "门头沟"
                        },
                        {
                            "district": "密云"
                        },
                        {
                            "district": "房山"
                        },
                        {
                            "district": "大兴"
                        },
                        {
                            "district": "石景山"
                        },
                        {
                            "district": "丰台"
                        },
                        {
                            "district": "延庆"
                        },
                        {
                            "district": "昌平"
                        },
                        {
                            "district": "通州"
                        },
                        {
                            "district": "怀柔"
                        },
                        {
                            "district": "顺义"
                        },
                        {
                            "district": "朝阳"
                        },
                        {
                            "district": "海淀"
                        }
                    ]
                }
            ],
            "province": "北京"
        }
    ]
}
                        

错误代码:

name type N D value
20701 城市名称参数为空
20702 查询不到该城市的空气质量

价格套餐:

name type N D value
免费套餐 免费 无限次
免费套餐 免费 无限次
MobSDK后台打包中:
查看
MobSDK打包中
正在根据你选择的SDK打包中:
取消下载
免费咨询
扫一扫添加公众号
24小时在线免费咨询