代码示例
GET CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, 接口URL地址); CURLcode ret = curl_easy_perform(hnd); POST CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, 接口URL地址); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, Json格式请求Body体); CURLcode ret = curl_easy_perform(hnd); GET curl -X GET 接口URL地址 POST curl -X POST -d 'Json格式请求Body体' 接口URL地址 GET var client = new RestClient(接口URL地址); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); POST var client = new RestClient(接口URL地址); var request = new RestRequest(Method.POST); request.AddParameter("undefined", Json格式请求Body体, ParameterType.RequestBody); IRestResponse response = client.Execute(request); GET package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := 接口URL地址 req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } POST package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := 接口URL地址 payload := strings.NewReader(Json格式请求Body体) req, _ := http.NewRequest("POST", url, payload) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } GET OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url(接口URL地址) .get() .build(); Response response = client.newCall(request).execute(); POST OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, Json格式请求Body体); Request request = new Request.Builder() .url(接口URL地址) .post(body) .build(); Response response = client.newCall(request).execute(); GET HttpResponse<String> response = Unirest.get(接口URL地址) .asString(); POST HttpResponse<String> response = Unirest.post(接口URL地址) .body(Json格式请求Body体) .asString(); GET var settings = { "async": true, "crossDomain": true, "url": 接口URL地址, "method": "GET", } $.ajax(settings).done(function (response) { console.log(response); }); POST var settings = { "async": true, "crossDomain": true, "url": 接口URL地址, "method": "POST", "data": Json格式请求Body体 } $.ajax(settings).done(function (response) { console.log(response); }); GET var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open("GET", 接口URL地址); xhr.send(data); POST var data = Json格式请求Body体; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open("POST", 接口URL地址); xhr.send(data); GET var http = require("http"); var options = { "method": "GET", "hostname": "service.envicloud.cn", "port": "8082", "path": 接口URL地址(从/v2开始), }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); POST var http = require("http"); var options = { "method": "POST", "hostname": "service.envicloud.cn", "port": "8082", "path": 接口URL地址(从/v2开始) }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(Json格式请求Body体); req.end(); GET var request = require("request"); var options = { method: 'GET', url: 接口URL地址 }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); POST var request = require("request"); var options = { method: 'POST', url: 接口URL地址, body: Json格式请求Body体 }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); GET var unirest = require("unirest"); var req = unirest("GET", 接口URL地址); req.end(function (res) { if (res.error) throw new Error(res.error); console.log(res.body); }); POST var unirest = require("unirest"); var req = unirest("POST", 接口URL地址); req.send(Json格式请求Body体); req.end(function (res) { if (res.error) throw new Error(res.error); console.log(res.body); }); GET #import <Foundation/Foundation.h> NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@接口URL地址] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; [request setHTTPMethod:@"GET"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"%@", error); } else { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response; NSLog(@"%@", httpResponse); } }]; [dataTask resume]; POST #import <Foundation/Foundation.h> NSData *postData = [[NSData alloc] initWithData:[@Json格式请求Body体 dataUsingEncoding:NSUTF8StringEncoding]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@接口URL地址] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; [request setHTTPMethod:@"POST"]; [request setHTTPBody:postData]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"%@", error); } else { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response; NSLog(@"%@", httpResponse); } }]; [dataTask resume]; GET <?php $request = new HttpRequest(); $request->setUrl(接口URL地址); $request->setMethod(HTTP_METH_GET); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; } POST <?php $request = new HttpRequest(); $request->setUrl(接口URL地址); $request->setMethod(HTTP_METH_POST); $request->setBody(Json格式请求Body体); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; } GET <?php $client = new http\Client; $request = new http\Client\Request; $request->setRequestUrl(接口URL地址); $request->setRequestMethod('GET'); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody(); POST <?php $client = new http\Client; $request = new http\Client\Request; $body = new http\Message\Body; $body->append(Json格式请求Body体); $request->setRequestUrl(接口URL地址); $request->setRequestMethod('POST'); $request->setBody($body); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody(); GET <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "8082", CURLOPT_URL => 接口URL地址, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => "", )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } POST <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "8082", CURLOPT_URL => 接口URL地址, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => Json格式请求Body体, )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } GET import http.client conn = http.client.HTTPConnection("service.envicloud.cn:8082") payload = "" headers = { 'cache-control': "no-cache" } conn.request("GET", 接口URL地址(从/V2开始), payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) POST import http.client conn = http.client.HTTPConnection("service.envicloud.cn:8082") payload = Json格式请求Body体 headers = { 'cache-control': "no-cache", } conn.request("POST", 接口URL地址(从/V2开始), payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) GET import requests url = 接口URL地址 payload = "" headers = { 'cache-control': "no-cache" } response = requests.request("GET", url, data=payload, headers=headers) print(response.text) POST import requests url = 接口URL地址 payload = Json格式请求Body体 headers = { 'cache-control': "no-cache", } response = requests.request("POST", url, data=payload, headers=headers) print(response.text) GET require 'uri' require 'net/http' url = URI(接口URL地址) http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body POST require 'uri' require 'net/http' url = URI(接口URL地址) http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Post.new(url) request.body = Json格式请求Body体 response = http.request(request) puts response.read_body GET wget --quiet \ --method GET \ --output-document \ - 接口URL地址 POST wget --quiet \ --method POST \ --body-data Json格式请求Body体 \ --output-document \ - 接口URL地址 GET http GET 接口URL地址 POST echo Json格式请求Body体 | \ http POST 接口URL地址 GET curl --request GET \ --url 接口URL地址 POST curl --request POST \ --url 接口URL地址 \ --data Json格式请求Body体 GET import Foundation let request = NSMutableURLRequest(url: NSURL(string: 接口URL地址)! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() POST import Foundation let postData = NSData(data: Json格式请求Body体.data(using: String.Encoding.utf8)!) let request = NSMutableURLRequest(url: NSURL(string: 接口URL地址)! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume()
API Version 2.0 文档
基础URL
http://service.envicloud.cn:8082
天气预报查询
城市天气预报
接口说明
根据城市编码查询指定城市7天天气预报和生活指数
数据更新
每天9点
GET
/v2/weatherforecast/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "citycode":"101190101", "rdesc":"Success", "forecast": [{ "wind":{ "dir":"东风", "deg":"74", "sc":"3-4", "spd":"11" }, "hum":"94", "astro":{ "mr":"19:57", "sr":"06:35", "ms":"09:07", "ss":"17:04" }, "pcpn":"11.0", "uv":"2", "tmp":{ "min":"14", "max":"16" }, "pop":"100", "pres":"1020", "date":"2016-11-17", "cond":{ "cond_n":"小雨", "cond_d":"阴" }, "vis":"2" },{ "wind":{ "dir":"西南风", "deg":"272", "sc":"3-4", "spd":"12" }, "hum":"93", "astro":{ "mr":"20:58", "sr":"06:36", "ms":"10:06", "ss":"17:03" }, "pcpn":"8.0", "uv":"2", "tmp":{ "min":"16", "max":"19" }, "pop":"79", "pres":"1015", "date":"2016-11-18", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"10" },{ "wind":{ "dir":"北风", "deg":"331", "sc":"微风", "spd":"3" }, "hum":"88", "astro":{ "mr":"21:59", "sr":"06:37", "ms":"10:59", "ss":"17:03" }, "pcpn":"0.1", "uv":"3", "tmp":{ "min":"15", "max":"20" }, "pop":"4", "pres":"1016", "date":"2016-11-19", "cond":{ "cond_n":"阴", "cond_d":"阴" }, "vis":"10" },{ "wind":{ "dir":"东北风", "deg":"75", "sc":"4-5", "spd":"17" }, "hum":"93", "astro":{ "mr":"22:59", "sr":"06:38", "ms":"11:46", "ss":"17:02" }, "pcpn":"4.4", "uv":"1", "tmp":{ "min":"14", "max":"17" }, "pop":"82", "pres":"1020", "date":"2016-11-20", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"2" },{ "wind":{ "dir":"东风", "deg":"90", "sc":"4-5", "spd":"24" }, "hum":"93", "astro":{ "mr":"23:57", "sr":"06:39", "ms":"12:27", "ss":"17:02" }, "pcpn":"24.2", "uv":"N/A", "tmp":{ "min":"12", "max":"16" }, "pop":"81", "pres":"1018", "date":"2016-11-21", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"2" },{ "wind":{ "dir":"北风", "deg":"28", "sc":"5-6", "spd":"29" }, "hum":"91", "astro":{ "mr":"null", "sr":"06:40", "ms":"13:05", "ss":"17:02" }, "pcpn":"10.7", "uv":"N/A", "tmp":{ "min":"5", "max":"16" }, "pop":"83", "pres":"1025", "date":"2016-11-22", "cond":{ "cond_n":"小雨", "cond_d":"阴" }, "vis":"9" },{ "wind":{ "dir":"北风", "deg":"27", "sc":"4-5", "spd":"24" }, "hum":"86", "astro":{ "mr":"00:53", "sr":"06:41", "ms":"13:40", "ss":"17:01" }, "pcpn":"8.8", "uv":"N/A", "tmp":{ "min":"3", "max":"12" }, "pop":"82", "pres":"1032", "date":"2016-11-23", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"10" }], "rcode":200, "suggestion":{ "trav":{ "brf":"适宜", "txt":"天气较好,风稍大,但温度适宜,总体来说还是好天气。这样的天气适宜旅游,您可以尽情享受大自然的风光。" }, "uv":{ "brf":"最弱", "txt":"属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。" }, "flu":{ "brf":"少发", "txt":"各项气象条件适宜,无明显降温过程,发生感冒机率较低。" }, "comf":{ "brf":"舒适", "txt":"白天不太热也不太冷,风力不大,相信您在这样的天气条件下,应会感到比较清爽和舒适。" }, "sport":{ "brf":"较适宜", "txt":"阴天,较适宜进行各种户内外运动。" }, "air":{ "brf":"良", "txt":"气象条件有利于空气污染物稀释、扩散和清除,可在室外正常活动。" }, "cw":{ "brf":"较适宜", "txt":"较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。" }, "drs":{ "brf":"较舒适", "txt":"建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。" } } ,"cityname":"南京" }
POST
/v2/weatherforecast
请求参数说明
请求示例{ "accesskey":"您的Accesskey", "citycodes":[ "101190101" ] } 响应参数说明
响应示例{ "rdesc":"Success", "rcode":200, "info": [{ "citycode":"101190101", "forecast": [{ "wind":{ "dir":"东风", "deg":"74", "sc":"3-4", "spd":"11" }, "hum":"94", "astro":{ "mr":"19:57", "sr":"06:35", "ms":"09:07", "ss":"17:04" }, "pcpn":"11.0", "uv":"2", "tmp":{ "min":"14", "max":"16" }, "pop":"100", "pres":"1020", "date":"2016-11-17", "cond":{ "cond_n":"小雨", "cond_d":"阴" }, "vis":"2" },{ "wind":{ "dir":"西南风", "deg":"272", "sc":"3-4", "spd":"12" }, "hum":"93", "astro":{ "mr":"20:58", "sr":"06:36", "ms":"10:06", "ss":"17:03" }, "pcpn":"8.0", "uv":"2", "tmp":{ "min":"16", "max":"19" }, "pop":"79", "pres":"1015", "date":"2016-11-18", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"10" },{ "wind":{ "dir":"北风", "deg":"331", "sc":"微风", "spd":"3" }, "hum":"88", "astro":{ "mr":"21:59", "sr":"06:37", "ms":"10:59", "ss":"17:03" }, "pcpn":"0.1", "uv":"3", "tmp":{ "min":"15", "max":"20" }, "pop":"4", "pres":"1016", "date":"2016-11-19", "cond":{ "cond_n":"阴", "cond_d":"阴" }, "vis":"10" },{ "wind":{ "dir":"东北风", "deg":"75", "sc":"4-5", "spd":"17" }, "hum":"93", "astro":{ "mr":"22:59", "sr":"06:38", "ms":"11:46", "ss":"17:02" }, "pcpn":"4.4", "uv":"1", "tmp":{ "min":"14", "max":"17" }, "pop":"82", "pres":"1020", "date":"2016-11-20", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"2" },{ "wind":{ "dir":"东风", "deg":"90", "sc":"4-5", "spd":"24" }, "hum":"93", "astro":{ "mr":"23:57", "sr":"06:39", "ms":"12:27", "ss":"17:02" }, "pcpn":"24.2", "uv":"N/A", "tmp":{ "min":"12", "max":"16" }, "pop":"81", "pres":"1018", "date":"2016-11-21", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"2" },{ "wind":{ "dir":"北风", "deg":"28", "sc":"5-6", "spd":"29" }, "hum":"91", "astro":{ "mr":"null", "sr":"06:40", "ms":"13:05", "ss":"17:02" }, "pcpn":"10.7", "uv":"N/A", "tmp":{ "min":"5", "max":"16" }, "pop":"83", "pres":"1025", "date":"2016-11-22", "cond":{ "cond_n":"小雨", "cond_d":"阴" }, "vis":"9" },{ "wind":{ "dir":"北风", "deg":"27", "sc":"4-5", "spd":"24" }, "hum":"86", "astro":{ "mr":"00:53", "sr":"06:41", "ms":"13:40", "ss":"17:01" }, "pcpn":"8.8", "uv":"N/A", "tmp":{ "min":"3", "max":"12" }, "pop":"82", "pres":"1032", "date":"2016-11-23", "cond":{ "cond_n":"小雨", "cond_d":"小雨" }, "vis":"10" }], "suggestion":{ "trav":{ "brf":"适宜", "txt":"天气较好,风稍大,但温度适宜,总体来说还是好天气。这样的天气适宜旅游,您可以尽情享受大自然的风光。" }, "uv":{ "brf":"最弱", "txt":"属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。" }, "flu":{ "brf":"少发", "txt":"各项气象条件适宜,无明显降温过程,发生感冒机率较低。" }, "comf":{ "brf":"舒适", "txt":"白天不太热也不太冷,风力不大,相信您在这样的天气条件下,应会感到比较清爽和舒适。" }, "sport":{ "brf":"较适宜", "txt":"阴天,较适宜进行各种户内外运动。" }, "air":{ "brf":"良", "txt":"气象条件有利于空气污染物稀释、扩散和清除,可在室外正常活动。" }, "cw":{ "brf":"较适宜", "txt":"较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。" }, "drs":{ "brf":"较舒适", "txt":"建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。" } } ,"cityname":"南京" }] }
海区天气预报
接口说明
查询全国海区天气预报
数据更新
每天7点
GET
/v2/marineforecast/{accesskey}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":73, "forecast": [{ "station":"浙江北部沿岸", "vis1":"12", "lng":"122.83", "vis2":"12", "type":"沿海", "wpow1":"2", "time":"2016_09_09_08", "wdir1":"东北东", "wpow2":"3", "wdir2":"东北东", "weather1":"多云", "weather2":"多云", "lat":"30.18" }, ……, { "station":"东海北部", "vis1":"10", "lng":"125.77", "vis2":"10", "type":"近海", "wpow1":"2", "time":"2016_09_09_08", "wdir1":"西北风", "wpow2":"1", "wdir2":"北风", "weather1":"小雨", "weather2":"小雨", "lat":"30.78" }, ……, { "station":"马六甲海峡", "vis1":"8", "lng":"98.8", "vis2":"6", "type":"远海", "wpow1":"2", "time":"2016_09_09_08", "wdir1":"西风", "wpow2":"2", "wdir2":"西南风", "weather1":"中雨", "weather2":"大雨", "lat":"5.8" }], "rcode":200 } 历史天气查询
24小时历史天气
接口说明
查询指定城市过去24小时的历史天气
数据更新
每小时
GET
/v2/weatherhistory/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "history": [{ "windspeed":"0.3", "airpressure":"1004.0", "phenomena":"晴", "humidity":"62.0", "updatetime":"2016-09-08 10:05", "windpower":"微风", "feelst":"24.7", "winddirect":"东北风", "rain":"0.0", "temperature":"24.4" },{ "windspeed":"1.9", "airpressure":"1004.0", "phenomena":"晴", "humidity":"49.0", "updatetime":"2016-09-08 11:05", "windpower":"微风", "feelst":"24.5", "winddirect":"西北风", "rain":"0.0", "temperature":"26.5" }, ……, { "windspeed":"3.1", "airpressure":"1005.0", "phenomena":"晴", "humidity":"36.0", "updatetime":"2016-09-09 09:05", "windpower":"微风", "feelst":"23.1", "winddirect":"西北风", "rain":"0.0", "temperature":"26.1" }], "rdesc":"Success", "rcode":200 }
指定日期历史天气
接口说明
查询指定城市指定日期的历史天气
数据更新
每天
GET
/v2/weatherhistory/{accesskey}/{citycode}/{date}
请求参数说明
响应参数说明
响应示例{ "hum_avg":"63.67", "citycode":"101010100", "rain_percent":0, "tem_max":"31.0", "rdesc":"Success", "rain_full":"0.0", "tem_avg":"24.63", "tem_min":"16.8", "rcode":200, "date":"20160908", "wdir_most":"西南风", "pressure_avg":"1002.88", "sunny_percent":100, "wspd_avg":"1.56m/s" }
指定小时历史天气
接口说明
查询指定城市指定小时的历史天气
数据更新
每小时
GET
/v2/weatherhistory/{accesskey}/{citycode}/{date}/{hour}
请求参数说明
响应参数说明
响应示例{ "windspeed":"1.9", "airpressure":"1005.0", "phenomena":"晴", "rdesc":"Success", "humidity":"55.0", "updatetime":"2016-09-09 08:05", "windpower":"微风", "feelst":"23.0", "winddirect":"东北风", "rcode":200, "rain":"0.0", "temperature":"23.1" }
月度历史天气
接口说明
查询指定城市指定年份12个月的月度历史天气
数据更新
每年
GET
/v2/monthlymete/{accesskey}/{citycode}/{year}/{type}
请求参数说明
响应参数说明
响应示例{ "citycode":"101010100", "rdesc":"Success", "rcode":200, "info": [{ "tem_max":"5.0", "pre":"0.7", "tem_min":"-13.0", "month":1, "year":2015, "tem_avg":"-3.5" },{ "tem_max":"7.1", "pre":"8.2", "tem_min":"-11.8", "month":2, "year":2015, "tem_avg":"-1.3" },{ "tem_max":"15.4", "pre":"1.6", "tem_min":"-5.6", "month":3, "year":2015, "tem_avg":"6.3" },{ "tem_max":"22.0", "pre":"35.2", "tem_min":"2.0", "month":4, "year":2015, "tem_avg":"13.5" },{ "tem_max":"27.5", "pre":"44.3", "tem_min":"7.6", "month":5, "year":2015, "tem_avg":"19.3" },{ "tem_max":"30.8", "pre":"65.9", "tem_min":"12.4", "month":6, "year":2015, "tem_avg":"22.5" },{ "tem_max":"32.1", "pre":"160.3", "tem_min":"15.3", "month":7, "year":2015, "tem_avg":"24.8" },{ "tem_max":"31.8", "pre":"77.1", "tem_min":"14.0", "month":8, "year":2015, "tem_avg":"24.1" },{ "tem_max":"26.3", "pre":"117.8", "tem_min":"9.4", "month":9, "year":2015, "tem_avg":"18.4" },{ "tem_max":"20.3", "pre":"14.2", "tem_min":"2.5", "month":10, "year":2015, "tem_avg":"12.0" },{ "tem_max":"6.9", "pre":"45.8", "tem_min":"-5.7", "month":11, "year":2015, "tem_avg":"1.4" },{ "tem_max":"4.4", "pre":"2.0", "tem_min":"-11.1", "month":12, "year":2015, "tem_avg":"-2.5" }] }
年度历史天气
接口说明
查询指定城市指定时段的年度历史天气
数据更新
每年
GET
/v2/yearlymete/{accesskey}/{citycode}/{start_year}/{end_year}/{type}
请求参数说明
响应参数说明
响应示例{ "citycode":"101010100", "rdesc":"Success", "rcode":200, "info": [{ "tem_jan":"-3.2", "pre_full":"456.0", "year":2014, "tem_july":"26.1" },{ "tem_jan":"-3.5", "pre_full":"573.1", "year":2015, "tem_july":"24.8" }] } 天气实况查询
城市天气实况
接口说明
查询指定城市的天气实况
数据更新
每小时
GET
/v2/weatherlive/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "windspeed":"1.9", "airpressure":"1005.0", "phenomena":"晴", "rdesc":"Success", "humidity":"55.0", "updatetime":"2016-09-09 08:05", "windpower":"微风", "feelst":"23.0", "winddirect":"东北风", "rcode":200, "rain":"0.0", "temperature":"23.1" }
POST
/v2/weatherlive
请求参数说明
请求示例{ "accesskey":"您的Accesskey", "citycodes":[ "101190101", "101010100" ] } 响应参数说明
响应示例{ "rdesc":"Success", "rcode":200, "info": [{ "windspeed":"2.3", "citycode":"101010100", "phenomena":"晴", "airpressure":"1002.0", "humidity":"28.0", "updatetime":"2016-09-08 14:05", "windpower":"微风", "feelst":"27.3", "winddirect":"西北风", "weekofday":"4", "rain":"0.0", "temperature":"30.6" },{ "windspeed":"2.3", "citycode":"101190101", "phenomena":"多云", "airpressure":"1005.0", "humidity":"49.0", "updatetime":"2016-09-08 14:15", "windpower":"微风", "feelst":"28.2", "winddirect":"东南风", "weekofday":"4", "rain":"0.0", "temperature":"30.0" }] } 水体环境查询
水质周报
接口说明
查询指定年份和周数的全国主要水体的水质周报
数据更新
每周
GET
/v2/waterquality/{accesskey}/{year}/{week}/{filter}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":68, "rcode":200, "info": [{ "point":"上海青浦急水港", "DO":"7.68", "PH":"7.36", "thisweek":"劣Ⅴ", "drainage":"太湖流域", "NH3N":"5.03", "pollution":"氨氮", "CODMn":"5.50", "prevweek":"劣Ⅴ", "section":"急水港(苏-沪省界)", "river":"急水港河" }, ……, { "point":"甘肃兰州新城桥", "DO":"11.60", "PH":"7.81", "thisweek":"Ⅱ", "drainage":"黄河流域", "NH3N":"0.28", "pollution":"无", "CODMn":"2.10", "prevweek":"Ⅱ", "section":"干流", "river":"海拉尔河" }] } 空气质量查询
城市空气质量实况
接口说明
查询指定城市的空气质量实况
数据更新
每小时
GET
/v2/cityairlive/{accesskey}/{citycode}/{type}
请求参数说明
响应参数说明
响应示例{ "citycode":"101010100", "PM25":"9", "time":"2016090913", "rdesc":"Success", "PM10":"13", "SO2":"3.75", "o3":"55.17", "NO2":"15.75", "primary":"无", "rcode":200, "CO":"0.38", "AQI":"21" }
城市24小时空气质量
接口说明
查询指定城市过去24小时的空气质量
数据更新
每小时
GET
/v2/cityairhistory/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "history": [{ "citycode":"101010100", "PM25":"13", "time":"2016090815", "PM10":"4", "SO2":"2.60", "o3":"77.60", "NO2":"13.00", "primary":"无", "CO":"0.35", "AQI":"28" },{ "citycode":"101010100", "PM25":"12", "time":"2016090817", "PM10":"27", "SO2":"2.67", "o3":"77.83", "NO2":"15.67", "primary":"颗粒物(PM10)", "CO":"0.31", "AQI":"37" }, ……, { "citycode":"101010100", "PM25":"10", "time":"2016090914", "PM10":"12", "SO2":"3.08", "o3":"60.00", "NO2":"14.00", "primary":"无", "CO":"0.34", "AQI":"22" }], "rdesc":"Success", "rcode":200 }
城市指定日期空气质量
接口说明
查询指定城市指定日期的空气质量
数据更新
每天
GET
/v2/citydailyair/{accesskey}/{citycode}/{date}/{type}
请求参数说明
响应参数说明
响应示例{ "rcode":200, "rdesc":"Success", "citycode":"101010100", "date":"20160908", "o3_avg":"40.74", "o3_min":"0.00", "NO2_avg":"40.40", "PM10_avg":"28", "PM10_max":"135", "o3_max":"47.00", "NO2_max":"117.00", "PM25_avg":"20", "NO2_min":"0.00", "PM10_min":"0", "AQI_avg":"39", "CO_max":"1.30", "SO2_avg":"2.50", "CO_min":"0.00", "PM25_max":"44", "SO2_min":"0.00", "AQI_max":"93", "PM25_min":"5", "SO2_max":"26.00", "AQI_min":"0", "CO_avg":"0.57" }
城市指定小时空气质量
接口说明
查询指定城市指定小时的空气质量
数据更新
每小时
GET
/v2/cityhourlyair/{accesskey}/{citycode}/{time}/{type}
请求参数说明
响应参数说明
响应示例{ "rcode":200, "rdesc":"Success", "citycode":"101010100", "time":"2016090908", "PM25":"19", "PM10":"44", "SO2":"3.33", "o3":"8.58", "NO2":"49.67", "primary":"无", "CO":"0.56", "AQI":"43" }
空气质量支持城市列表
接口说明
查询空气质量支持的城市列表
数据更新
暂无
GET
/v2/air/cities/{accesskey}
请求参数说明
响应参数说明
响应示例{ "rcode": 200 "rdesc": "Success", "cities": [ { "citycode": "101190102", "belong": "南京", "cityname": "溧水" }, { "citycode": "101190101", "belong": "南京", "cityname": "南京" }, { "citycode": "101010100", "belong": "北京", "cityname": "北京" }, { "citycode": "101030100", "belong": "天津", "cityname": "天津" }, …… { "citycode": "101190107", "belong": "南京", "cityname": "浦口" } ] }
城市空气质量测点列表
接口说明
查询指定城市的空气质量测点列表
数据更新
暂无
GET
/v2/air/devices/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "rdesc": "Success", "rcode": 200, "citycode": "101010100", "cityname": "北京", "devices": [ { "devid": "1001A", "stationname": "万寿西宫", "lng": "116.375", "lat": "39.886" }, { "devid": "1002A", "stationname": "定陵", "lng": "116.232", "lat": "40.301" }, { "devid": "1003A", "stationname": "东四", "lng": "116.396", "lat": "39.93" }, { "devid": "1004A", "stationname": "天坛", "lng": "116.413", "lat": "39.886" }, { "devid": "1005A", "stationname": "农展馆", "lng": "116.47", "lat": "39.947" }, { "devid": "1006A", "stationname": "官园", "lng": "116.365", "lat": "39.937" }, { "devid": "1007A", "stationname": "海淀区万柳", "lng": "116.306", "lat": "39.973" }, { "devid": "1008A", "stationname": "顺义新城", "lng": "116.659", "lat": "40.187" }, { "devid": "1009A", "stationname": "怀柔镇", "lng": "116.647", "lat": "40.308" }, { "devid": "1010A", "stationname": "昌平镇", "lng": "116.227", "lat": "40.229" }, { "devid": "1011A", "stationname": "奥体中心", "lng": "116.407", "lat": "39.991" }, { "devid": "1012A", "stationname": "古城", "lng": "116.502", "lat": "40.11" }, { "devid": "94062", "stationname": "中国环境科学研究院", "lng": "116.426", "lat": "40.048" } ] }
城市全测点空气质量实况
接口说明
查询指定城市所有测点的空气质量实况
数据更新
每小时
GET
/v2/air/live/city/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "rcode": 200, "rdesc": "Success", "citycode": "101010100", "cityname": "北京", "time": "2017030913", "info": [ { "PM25": "8", "prkey": "无", "PM10": "15", "SO2": "2", "o3": "79", "devid": "1001A", "NO2": "7", "stationname": "万寿西宫", "CO": "0.3", "AQI": "25" }, { "PM25": "12", "prkey": "无", "PM10": "30", "SO2": "4", "o3": "93", "devid": "1002A", "NO2": "3", "stationname": "定陵", "CO": "0.3", "AQI": "30" }, { "PM25": "7", "prkey": "无", "PM10": "14", "SO2": "3", "o3": "89", "devid": "1003A", "NO2": "8", "stationname": "东四", "CO": "0.3", "AQI": "28" }, { "PM25": "14", "prkey": "无", "PM10": "0", "SO2": "2", "o3": "107", "devid": "1004A", "NO2": "22", "stationname": "天坛", "CO": "0.3", "AQI": "34" }, { "PM25": "9", "prkey": "无", "PM10": "21", "SO2": "4", "o3": "69", "devid": "1005A", "NO2": "13", "stationname": "农展馆", "CO": "0.3", "AQI": "22" }, { "PM25": "6", "prkey": "无", "PM10": "15", "SO2": "2", "o3": "78", "devid": "1006A", "NO2": "18", "stationname": "官园", "CO": "0.3", "AQI": "25" }, { "PM25": "7", "prkey": "无", "PM10": "23", "SO2": "3", "o3": "2", "devid": "1007A", "NO2": "8", "stationname": "海淀区万柳", "CO": "0.3", "AQI": "23" }, { "PM25": "9", "prkey": "无", "PM10": "20", "SO2": "4", "o3": "0", "devid": "1008A", "NO2": "0", "stationname": "顺义新城", "CO": "0.3", "AQI": "20" }, { "PM25": "9", "prkey": "无", "PM10": "13", "SO2": "3", "o3": "112", "devid": "1009A", "NO2": "7", "stationname": "怀柔镇", "CO": "0.2", "AQI": "35" }, { "PM25": "13", "prkey": "无", "PM10": "35", "SO2": "6", "o3": "59", "devid": "1010A", "NO2": "21", "stationname": "昌平镇", "CO": "0.5", "AQI": "35" }, { "PM25": "6", "prkey": "无", "PM10": "15", "SO2": "3", "o3": "112", "devid": "1011A", "NO2": "10", "stationname": "奥体中心", "CO": "0.3", "AQI": "35" }, { "PM25": "10", "prkey": "无", "PM10": "25", "SO2": "3", "o3": "62", "devid": "1012A", "NO2": "10", "stationname": "古城", "CO": "0.3", "AQI": "25" }, { "PM25": "28", "prkey": "无", "PM10": "0", "SO2": "0", "o3": "0", "devid": "94062", "NO2": "0", "stationname": "中国环境科学研究院", "CO": "0", "AQI": "0" } ] }
单测点空气质量实况
接口说明
查询指定测点的空气质量实况
数据更新
每小时
GET
/v2/air/live/device/{accesskey}/{devid}
请求参数说明
响应参数说明
响应示例{ "rdesc": "Success", "rcode": 200, "info": { "PM25": "8", "prkey": "无", "PM10": "15", "SO2": "2", "o3": "79", "devid": "1001A", "NO2": "7", "stationname": "万寿西宫", "CO": "0.3", "AQI": "25" } }
城市全测点指定小时空气质量
接口说明
查询指定城市所有测点指定小时的空气质量
数据更新
每小时
GET
/v2/air/hourly/city/{accesskey}/{citycode}/{time}
请求参数说明
响应参数说明
响应示例{ "rcode": 200, "rdesc": "Success", "citycode": "101010100", "cityname": "北京", "time": "2017030800", "info": [ { "PM25": "3", "prkey": "无", "PM10": "8", "SO2": "2", "o3": "59", "devid": "1001A", "NO2": "22", "stationname": "万寿西宫", "CO": "0.3", "AQI": "19" }, { "PM25": "6", "prkey": "无", "PM10": "12", "SO2": "2", "o3": "85", "devid": "1002A", "NO2": "2", "stationname": "定陵", "CO": "0.2", "AQI": "27" }, { "PM25": "5", "prkey": "无", "PM10": "11", "SO2": "5", "o3": "67", "devid": "1003A", "NO2": "23", "stationname": "东四", "CO": "0.4", "AQI": "21" }, { "PM25": "6", "prkey": "无", "PM10": "21", "SO2": "2", "o3": "70", "devid": "1004A", "NO2": "21", "stationname": "天坛", "CO": "0.3", "AQI": "22" }, { "PM25": "5", "prkey": "无", "PM10": "10", "SO2": "3", "o3": "53", "devid": "1005A", "NO2": "17", "stationname": "农展馆", "CO": "0.3", "AQI": "17" }, { "PM25": "3", "prkey": "无", "PM10": "7", "SO2": "3", "o3": "56", "devid": "1006A", "NO2": "17", "stationname": "官园", "CO": "0.3", "AQI": "18" }, { "PM25": "6", "prkey": "无", "PM10": "13", "SO2": "2", "o3": "66", "devid": "1007A", "NO2": "23", "stationname": "海淀区万柳", "CO": "0.2", "AQI": "21" }, { "PM25": "8", "prkey": "无", "PM10": "27", "SO2": "4", "o3": "41", "devid": "1008A", "NO2": "45", "stationname": "顺义新城", "CO": "0.5", "AQI": "27" }, { "PM25": "7", "prkey": "无", "PM10": "0", "SO2": "2", "o3": "104", "devid": "1009A", "NO2": "2", "stationname": "怀柔镇", "CO": "0.2", "AQI": "33" }, { "PM25": "11", "prkey": "无", "PM10": "16", "SO2": "5", "o3": "39", "devid": "1010A", "NO2": "32", "stationname": "昌平镇", "CO": "0.5", "AQI": "16" }, { "PM25": "3", "prkey": "无", "PM10": "7", "SO2": "4", "o3": "89", "devid": "1011A", "NO2": "18", "stationname": "奥体中心", "CO": "0.3", "AQI": "28" }, { "PM25": "6", "prkey": "无", "PM10": "0", "SO2": "3", "o3": "49", "devid": "1012A", "NO2": "15", "stationname": "古城", "CO": "0.3", "AQI": "16" }, { "PM25": "28", "prkey": "无", "PM10": "", "SO2": "", "o3": "", "devid": "94062", "NO2": "", "stationname": "中国环境科学研究院", "CO": "", "AQI": "" } ] }
单测点指定小时空气质量
接口说明
查询指定测点指定小时的空气质量
数据更新
每小时
GET
/v2/air/hourly/device/{accesskey}/{devid}/{time}
请求参数说明
响应参数说明
响应示例{ "rdesc": "Success", "rcode": 200, "info": { "PM25": "3", "prkey": "无", "PM10": "8", "SO2": "2", "o3": "59", "devid": "1001A", "NO2": "22", "stationname": "万寿西宫", "CO": "0.3", "AQI": "19" } }
单测点指定日期空气质量
接口说明
查询指定测点指定日期的每小时空气质量
数据更新
每天
GET
/v2/air/daily/device/{accesskey}/{devid}/{date}
请求参数说明
响应参数说明
响应示例{ "rcode": 200, "rdesc": "Success", "devid": "1001A", "stationname": "万寿西宫", "info": [ { "PM25": "3", "time": "2017030800", "PM10": "8", "SO2": "2", "o3": "59", "NO2": "22", "CO": "0.3", "AQI": "19" }, { "PM25": "7", "time": "2017030801", "PM10": "8", "SO2": "2", "o3": "55", "NO2": "25", "CO": "0.4", "AQI": "18" }, { "PM25": "4", "time": "2017030802", "PM10": "12", "SO2": "2", "o3": "48", "NO2": "29", "CO": "0.4", "AQI": "15" }, { "PM25": "6", "time": "2017030803", "PM10": "8", "SO2": "2", "o3": "50", "NO2": "25", "CO": "0.4", "AQI": "16" }, { "PM25": "6", "time": "2017030804", "PM10": "10", "SO2": "3", "o3": "53", "NO2": "23", "CO": "0.4", "AQI": "17" }, { "PM25": "5", "time": "2017030805", "PM10": "13", "SO2": "3", "o3": "54", "NO2": "18", "CO": "0.4", "AQI": "17" }, { "PM25": "6", "time": "2017030806", "PM10": "18", "SO2": "2", "o3": "58", "NO2": "17", "CO": "0.3", "AQI": "19" }, { "PM25": "6", "time": "2017030807", "PM10": "22", "SO2": "2", "o3": "59", "NO2": "19", "CO": "0.3", "AQI": "22" }, { "PM25": "7", "time": "2017030808", "PM10": "28", "SO2": "2", "o3": "59", "NO2": "21", "CO": "0.4", "AQI": "28" }, { "PM25": "7", "time": "2017030809", "PM10": "29", "SO2": "3", "o3": "51", "NO2": "30", "CO": "0.4", "AQI": "29" }, { "PM25": "9", "time": "2017030810", "PM10": "24", "SO2": "2", "o3": "55", "NO2": "26", "CO": "0.4", "AQI": "24" }, { "PM25": "12", "time": "2017030811", "PM10": "27", "SO2": "2", "o3": "67", "NO2": "15", "CO": "0.4", "AQI": "27" }, { "PM25": "9", "time": "2017030812", "PM10": "25", "SO2": "2", "o3": "78", "NO2": "10", "CO": "0.3", "AQI": "25" }, { "PM25": "11", "time": "2017030813", "PM10": "25", "SO2": "2", "o3": "86", "NO2": "7", "CO": "0.3", "AQI": "27" }, { "PM25": "11", "time": "2017030814", "PM10": "23", "SO2": "2", "o3": "89", "NO2": "6", "CO": "0.3", "AQI": "28" }, { "PM25": "14", "time": "2017030815", "PM10": "33", "SO2": "2", "o3": "92", "NO2": "5", "CO": "0.3", "AQI": "33" }, { "PM25": "12", "time": "2017030816", "PM10": "35", "SO2": "2", "o3": "90", "NO2": "5", "CO": "0.3", "AQI": "35" }, { "PM25": "10", "time": "2017030817", "PM10": "28", "SO2": "2", "o3": "87", "NO2": "6", "CO": "0.3", "AQI": "28" }, { "PM25": "8", "time": "2017030818", "PM10": "9", "SO2": "2", "o3": "84", "NO2": "8", "CO": "0.3", "AQI": "27" }, { "PM25": "8", "time": "2017030819", "PM10": "33", "SO2": "2", "o3": "80", "NO2": "14", "CO": "0.3", "AQI": "33" }, { "PM25": "10", "time": "2017030820", "PM10": "35", "SO2": "2", "o3": "66", "NO2": "25", "CO": "0.4", "AQI": "35" }, { "PM25": "10", "time": "2017030821", "PM10": "35", "SO2": "2", "o3": "66", "NO2": "25", "CO": "0.4", "AQI": "35" }, { "PM25": "17", "time": "2017030822", "PM10": "35", "SO2": "3", "o3": "52", "NO2": "35", "CO": "0.5", "AQI": "35" }, { "PM25": "13", "time": "2017030823", "PM10": "30", "SO2": "4", "o3": "51", "NO2": "32", "CO": "0.5", "AQI": "30" } ] } 污染排放查询
年度污染排放
接口说明
查询指定年份的全国污染排放
数据更新
暂无
GET
/v2/discharge/{accesskey}/{year}/{filter}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":32, "rcode":200, "year":"2004", "info": [{ "index":"六价铬", "category":"空气污染物排放", "value":"15.748 吨", "province":"江苏" }, ……, { "index":"生活及其他烟尘", "category":"空气污染物排放", "value":"1.7 万吨", "province":"江苏" }] }
省级历史污染排放
接口说明
查询指定省份指定时段的历史污染排放年报
数据更新
暂无
GET
/v2/periodicdischarge/{accesskey}/{start_year}/{end_year}/{province}/{filter}
请求参数说明
响应参数说明
响应示例{ "rcode":200, "rdesc":"Success", "count":2, "province":"江苏", "info": [{ "index":"工业烟尘", "category":"空气污染物排放", "value":"39.8 万吨", "year":"2004" },{ "index":"工业烟尘", "category":"空气污染物排放", "value":"42.6 万吨", "year":"2005" }] } 城市辐射查询
城市大气辐射
接口说明
查询从2011年3月12日到2015年12月20日的全国每日辐射环境数据
数据更新
暂无
GET
/v2/radiation/{accesskey}/{date}
请求参数说明
响应参数说明
响应示例{ { "rcode":200, "rdesc":"Success", "datasource":"湖南省环境保护厅", "info": [{ "time":"2015120308_0315", "range":"90.9-91.2", "conclusion":"正常水平", "place":"上海市", "reference":"54.9-108.2", "average":"91.1" },{ …… }, …… ] } 地震查询
最近一次地震
接口说明
查询全球发生的最近一次地震
数据更新
每小时
GET
/v2/recentearthquake/{accesskey}
请求参数说明
响应参数说明
响应示例{ "rcode":200, "rdesc":"Success", "time":"2016-09-09 16:04:16", "updated":"2016-09-09 16:05:54", "mag":"1.08", "longitude":"-118.8816681", "latitude":"37.6331673", "place":"8km ESE of Mammoth Lakes, California", "depth":"6.58" }
指定日期地震
接口说明
查询指定日期发生的全球地震
数据更新
每天
GET
/v2/dailyearthquake/{accesskey}/{date}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":151, "rcode":200, "earthquakes": [{ "time":"2016-09-08 00:12:11", "updated":"2016-09-08 00:15:56", "mag":"0.44", "longitude":"-116.6545", "latitude":"33.5645", "place":"2km ENE of Anza, CA", "depth":"9.28" }, ……, { "time":"2016-09-08 23:56:44", "updated":"2016-09-09 00:02:30", "mag":"1.3", "longitude":"-150.9587", "latitude":"63.1828", "place":"103km WSW of Cantwell, Alaska", "depth":"155.8" }] }
指定城市地震
接口说明
查询指定城市受影响的地震
数据更新
每小时
GET
/v2/cityearthquake/{accesskey}/{citycode}/{count}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":2, "rcode":200, "earthquakes": [{ "distance":"243.507km", "time":"2016-09-09 08:30:01", "updated":"2016-09-09 09:14:09", "mag":"5.3", "longitude":"128.9744", "latitude":"41.2982", "place":"15km ENE of Sungjibaegam, North Korea", "depth":"0.0" },{ "distance":"746.417km", "time":"2016-09-07 12:28:49", "updated":"2016-09-07 13:11:49", "mag":"4.9", "longitude":"140.0558", "latitude":"36.1851", "place":"4km WSW of Tsukuba, Japan", "depth":"47.6" }] }
指定时段地震
接口说明
查询指定时段全球发生的地震
数据更新
每天
GET
/v2/periodicearthquake/{accesskey}/{start_date}/{end_date}/{min_mag}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":79, "rcode":200, "earthquakes": [{ "time":"2016-09-07 00:35:59", "updated":"2016-09-07 00:47:11", "mag":"2.12", "longitude":"-116.039", "latitude":"33.1741667", "place":"9km ENE of Ocotillo Wells, CA", "depth":"2.05" }, ……, { "time":"2016-09-08 23:21:35", "updated":"2016-09-08 23:33:29", "mag":"2.0", "longitude":"-152.5901", "latitude":"59.412", "place":"59km SW of Anchor Point, Alaska", "depth":"81.8" }] } 台风查询
台风概要
接口说明
查询2002到2016年指定年份的台风概要信息
数据更新
每年
GET
/v2/typhoon/{accesskey}/{year}
请求参数说明
响应参数说明
响应示例{ "rcode":200, "rdesc":"Success", "info": [ "PAKHAR", "SANVU", "MAWAR", "GUCHOL", "TALIM", "DOKSURI", "KHANUN", "VICENTE", "SAOLA", "DAMREY", "HAIKUI", "KIROGI", "KAI-TAK", "TEMBIN", "BOLAVEN", "SANBA", "JELAWAT", "EWINIAR", "MALIKSI", "GAEMI", "PRAPIROON", "MARIA", "SON-TINH", "BOPHA", "WUKONG" ] }
台风详情
接口说明
查询2002到2016年指定台风的具体路径信息
数据更新
每年
GET
/v2/typhoon/{accesskey}/{year}/{name}
请求参数说明
响应参数说明
响应示例{ "resultCode":"0", "resultDesc":"Success", "info": { "id":"25", "name_cn":"悟空", "name_en":"WUKONG", "year":"2012", "path": [{ "time":"2012-12-25_08:00", "type":"2", "cwspd":"18", "cwsc":"", "cpres":"1000", "cr7":"150", "cr10":"", "lat":"10.3", "lng":"128.6" }] } } 城市位置查询
城市地理位置
接口说明
查询指定城市的地理位置坐标
数据更新
暂无
GET
/v2/location/{accesskey}/{citycode}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "rcode":200, "info": { "citylevel":"1", "countyname_cn":"北京", "countyname_en":"beijing", "altitude":"33", "zipcode":"100000", "uptime":"201509141100", "cityname_cn":"北京", "citycode":"101010100", "cityname_en":"beijing", "provincename_cn":"北京", "nationname_en":"china", "nationname_cn":"中国", "longitude":"116.391000", "provincename_en":"beijing", "latitude":"39.904000", "areanumber":"010" } } 坐标范围查询
范围覆盖城市
接口说明
查询指定坐标范围内覆盖的城市列表
数据更新
暂无
GET
/v2/area/{accesskey}/{start_lng}/{start_lat}/{end_lng}/{end_lat}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "count":7, "cities": [{ "citycode":"101190501", "longitude":"120.840000", "latitude":"32.016000", "cityname":"南通" },{ "citycode":"101190502", "longitude":"120.270000", "latitude":"32.320000", "cityname":"海安" },{ "citycode":"101190503", "longitude":"120.586000", "latitude":"32.245000", "cityname":"如皋" },{ "citycode":"101190707", "longitude":"120.508000", "latitude":"32.794000", "cityname":"东台" },{ "citycode":"101191203", "longitude":"120.092000", "latitude":"32.188000", "cityname":"泰兴" },{ "citycode":"101191204", "longitude":"120.090000", "latitude":"32.310000", "cityname":"姜堰" },{ "citycode":"101191205", "longitude":"120.282000", "latitude":"32.038000", "cityname":"靖江" }], "rcode":200 } 城市编码查询
所有城市编码
接口说明
查询所有支持城市的城市编码
数据更新
暂无
GET
/v2/citycode/{accesskey}
请求参数说明
响应参数说明
响应示例{ "rdesc":"Success", "rcode":200, "info": [{ "citycode":"101010100", "cityname":"北京" },{ "citycode":"101010200", "cityname":"海淀" }, ……, { "citycode":"101340406", "cityname":"云林" }] }
指定城市编码
接口说明
查询指定城市的城市编码
数据更新
暂无
GET
/v2/citycode/{accesskey}/{cityname}
请求参数说明
响应参数说明
响应示例{ "citycode":"101190101", "rdesc":"Success", "rcode":200, "cityname":"南京" } 定位服务
经纬度定位
接口说明
根据经纬度定位最接近的城市区域
数据更新
暂无
GET
/v2/locate/{accesskey}/{lng}/{lat}
请求参数说明
响应参数说明
响应示例{ "rcode": 200, "rdesc": "Success", "info": { "citycode": "101190102", "province": "江苏", "city": "南京", "county": "溧水" } } |