本接口每小时更新1次。空气质量指数提供实时空气质量情况,目前支持全国近400个城市;服务支持功能包括:查询空气质量、pm2.5、AQI指数,并给出空气质量级别和首要污染物等资料。
API文档
单个城市及其监测点PM数据 全国城市空气质量排行榜
单个城市及其监测点PM数据
调用地址:https://service-jkb9jx9n-1255468759.ap-shanghai.apigateway.myqcloud.com/release/city
请求方式:GET
返回类型:JSON
API调用: API调用说明(secret_id & secret_key)
请求参数(Headers)
| 名称 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| 暂无数据 | |||
请求参数(Query)
| 名称 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| city | string | 是 | 要查询的城市 | 
请求参数(Body)
| 名称 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| 暂无数据 | |||
请求示例
curl go java javascript php python c#
curl -v -X GET https://service-jkb9jx9n-1255468759.ap-shanghai.apigateway.myqcloud.com/release/city ?city=天津-H 'Host:service-jkb9jx9n-1255468759.ap-shanghai.apigateway.myqcloud.com' -H 'Source:source' -H 'Date:Mon, 19 Mar 2018 12:08:40 GMT' -H 'Authorization:hmac id = "AKIDi6qE41WgJ9w8h4h9zq68Vq24d1beIuN0qIwU", algorithm = "hmac-sha1", headers = "date source", signature = yMCxXNytW5nvVGNZ8aBtRxmiLJ4=' -H 'X-Requested-With:XMLHttpRequest' //请用云市场分配给您的密钥计算签名并放入请求头,Date为当前的GMT时间
package mainimport (    "crypto/hmac"    "crypto/sha1"    "encoding/base64"    "fmt"    "io"    "io/ioutil"    "net/http"    gourl "net/url"    "strings"    "time")func calcAuthorization(source string, secretId string, secretKey string) (auth string, datetime string, err error) {    timeLocation, _ := time.LoadLocation("Etc/GMT")    datetime = time.Now().In(timeLocation).Format("Mon, 02 Jan 2006 15:04:05 GMT")    signStr := fmt.Sprintf("x-date: %snx-source: %s", datetime, source)    // hmac-sha1    mac := hmac.New(sha1.New, []byte(secretKey))    mac.Write([]byte(signStr))    sign := base64.StdEncoding.EncodeToString(mac.Sum(nil))    auth = fmt.Sprintf("hmac id="%s""
                                                        
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!