国控空气质量城市级别批量接口

提供商: 上海青悦信息科技有限公司 标签: 大数据

在线客服:

服务时间:

7:30~20:30

联系邮箱:

support@epmap.org

联系电话:

021-60534095

站点日报

站点日报

请求参数(Headers)

名称 类型 是否必须 描述
无参数

请求参数(Qurey)

名称 类型 是否必须 描述
city String

请求参数(Body)

名称 类型 是否必须 描述
无参数

请求示例

  • python
  • curl
import urllib2, ssl, datetime, hmac, base64, hashlib

host = 'service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com'
url = 'https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release'
path = '/api/v1/nation_air/station_day_list'
querys = ''
querys += 'city='
source = 'source'
method ='GET'
GMT_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'

#云市场分配的密钥Id
SecretId='xxx'
#云市场分配的密钥Key
SecretKey='xxx'
dateTime = datetime.datetime.utcnow().strftime(GMT_FORMAT)
auth = "hmac id=\"" + SecretId + "\", algorithm=\"hmac-sha1\", headers=\"date source\", signature=\""
signStr = "date: " + dateTime + "\n" + "source: " + source
sign = hmac.new(SecretKey, signStr, hashlib.sha1).digest()
sign = base64.b64encode(sign)
sign = auth + sign + "\""

bodys = {}
url = url + path + '?' + querys
request = urllib2.Request(url)

request.add_header('Authorization', sign)
request.add_header('Host', host)
request.add_header('Source', 'source')
request.add_header('Date', dateTime)
request.add_header('X-Requested-With', 'XMLHttpRequest')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
	print(content)
curl -v -X GET https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release/api/v1/nation_air/station_day_list ?city=-H 'Host:service-5v2rb5oj-1255304211.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时间

正常返回示例

成功响应示例	
{
success: true,
data: [
[
{
province: "山东省",
city: "德州市",
o3_24h: 112,
station_code: "1622A",
co_24h: 1.683,
no2_24h: 59,
station: "儿童乐园",
so2_24h: 33,
pubtime: "2017-03-13 00:00:00",
pm2_5_24h: 61,
o3_8h_24h: 83,
pm10_24h: 120,
city_code: "371400"
},
...
]
]
}

返回码定义

返回码 返回信息 描述
无参数
站点时报

站点时报

请求参数(Headers)

名称 类型 是否必须 描述
无参数

请求参数(Qurey)

名称 类型 是否必须 描述
city String 城市名称

请求参数(Body)

名称 类型 是否必须 描述
无参数

请求示例

  • python
  • curl
import urllib2, ssl, datetime, hmac, base64, hashlib

host = 'service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com'
url = 'https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release'
path = '/api/v1/nation_air_by_city/station_realtime_list'
querys = ''
querys += 'city='
source = 'source'
method ='GET'
GMT_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'

#云市场分配的密钥Id
SecretId='xxx'
#云市场分配的密钥Key
SecretKey='xxx'
dateTime = datetime.datetime.utcnow().strftime(GMT_FORMAT)
auth = "hmac id=\"" + SecretId + "\", algorithm=\"hmac-sha1\", headers=\"date source\", signature=\""
signStr = "date: " + dateTime + "\n" + "source: " + source
sign = hmac.new(SecretKey, signStr, hashlib.sha1).digest()
sign = base64.b64encode(sign)
sign = auth + sign + "\""

bodys = {}
url = url + path + '?' + querys
request = urllib2.Request(url)

request.add_header('Authorization', sign)
request.add_header('Host', host)
request.add_header('Source', 'source')
request.add_header('Date', dateTime)
request.add_header('X-Requested-With', 'XMLHttpRequest')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
	print(content)
curl -v -X GET https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release/api/v1/nation_air_by_city/station_realtime_list ?city=-H 'Host:service-5v2rb5oj-1255304211.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时间

正常返回示例

{
success: true,
data: [
[
{
pm2_5: 96,
co: 1.6,
o3_24h: 159,
pollutions: "细颗粒物(PM2.5)",
quality: "轻度污染",
pm10_24h: 127,
no2: 28,
city: "德州市",
district: "",
o3_8h: 56,
station_code: "1624A",
station: "监理站",
so2_24h: 25,
pm2_5_24h: 87,
latitude: 37.4489,
o3: 85,
city_code: "371400",
province: "山东省",
co_24h: 1.5,
so2: 33,
aqi: 127,
pm10: 142,
level: "",
longitude: 116.3189,
o3_8h_24h: 56,
no2_24h: 33,
pubtime: "2017-03-30 13:00:00"
},
...
]
]
}

返回码定义

返回码 返回信息 描述
无参数
城市日报

城市日报

请求参数(Headers)

名称 类型 是否必须 描述
无参数

请求参数(Qurey)

名称 类型 是否必须 描述
city String 城市名称

请求参数(Body)

名称 类型 是否必须 描述
无参数

请求示例

  • python
  • curl
import urllib2, ssl, datetime, hmac, base64, hashlib

host = 'service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com'
url = 'https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release'
path = '/api/v1/nation_air_by_city/city_day_list'
querys = ''
querys += 'city='
source = 'source'
method ='GET'
GMT_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'

#云市场分配的密钥Id
SecretId='xxx'
#云市场分配的密钥Key
SecretKey='xxx'
dateTime = datetime.datetime.utcnow().strftime(GMT_FORMAT)
auth = "hmac id=\"" + SecretId + "\", algorithm=\"hmac-sha1\", headers=\"date source\", signature=\""
signStr = "date: " + dateTime + "\n" + "source: " + source
sign = hmac.new(SecretKey, signStr, hashlib.sha1).digest()
sign = base64.b64encode(sign)
sign = auth + sign + "\""

bodys = {}
url = url + path + '?' + querys
request = urllib2.Request(url)

request.add_header('Authorization', sign)
request.add_header('Host', host)
request.add_header('Source', 'source')
request.add_header('Date', dateTime)
request.add_header('X-Requested-With', 'XMLHttpRequest')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
	print(content)
curl -v -X GET https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release/api/v1/nation_air_by_city/city_day_list ?city=-H 'Host:service-5v2rb5oj-1255304211.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时间

正常返回示例

{
success: true,
data: [
[
{
province: "山东省",
city: "德州市",
level: "5",
o3_8h_24h: 8,
co_24h: 2.9,
no2_24h: 71,
so2_24h: 67,
pubtime: "2016-12-25 00:00:00",
pm2_5_24h: 174,
pollutions: "细颗粒物(PM2.5)",
aqi: 224,
pm10_24h: 258,
city_code: "371400"
}
],
...
]
]
}

返回码定义

返回码 返回信息 描述
无参数
城市时报

城市时报

请求参数(Headers)

名称 类型 是否必须 描述
无参数

请求参数(Qurey)

名称 类型 是否必须 描述
city String 城市名称

请求参数(Body)

名称 类型 是否必须 描述
无参数

请求示例

  • python
  • curl
import urllib2, ssl, datetime, hmac, base64, hashlib

host = 'service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com'
url = 'https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release'
path = '/api/v1/nation_air_by_city/city_realtime_list'
querys = ''
querys += 'city='
source = 'source'
method ='GET'
GMT_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'

#云市场分配的密钥Id
SecretId='xxx'
#云市场分配的密钥Key
SecretKey='xxx'
dateTime = datetime.datetime.utcnow().strftime(GMT_FORMAT)
auth = "hmac id=\"" + SecretId + "\", algorithm=\"hmac-sha1\", headers=\"date source\", signature=\""
signStr = "date: " + dateTime + "\n" + "source: " + source
sign = hmac.new(SecretKey, signStr, hashlib.sha1).digest()
sign = base64.b64encode(sign)
sign = auth + sign + "\""

bodys = {}
url = url + path + '?' + querys
request = urllib2.Request(url)

request.add_header('Authorization', sign)
request.add_header('Host', host)
request.add_header('Source', 'source')
request.add_header('Date', dateTime)
request.add_header('X-Requested-With', 'XMLHttpRequest')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
	print(content)
curl -v -X GET https://service-5v2rb5oj-1255304211.ap-shanghai.apigateway.myqcloud.com/release/api/v1/nation_air_by_city/city_realtime_list ?city=-H 'Host:service-5v2rb5oj-1255304211.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时间

正常返回示例

{
success: true,
data: [
[
{
pm2_5: 54,
co: 0.733,
o3_24h: 156,
pollutions: "颗粒物(PM10)",
quality: "良",
pm10_24h: 124,
no2: 22,
city: "德州市",
o3_8h: 99,
so2_24h: 30,
pm2_5_24h: 67,
latitude: "",
o3: 144,
city_code: "371400",
province: "山东省",
co_24h: 0.967,
so2: 25,
aqi: 79,
pm10: 106,
level: "2",
longitude: "",
o3_8h_24h: 99,
no2_24h: 56,
pubtime: "2017-03-15 16:00:00"
}
],
...
]
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

返回码定义

返回码 返回信息 描述
无参数
  • 站点日报

    请求方式 GET 返回类型 JSON
  • 站点时报

    请求方式 GET 返回类型 JSON
  • 城市日报

    请求方式 GET 返回类型 JSON
  • 城市时报

    请求方式 GET 返回类型 JSON
查看接口详情

服务商联系方式

在线客服:

服务时间:

7:30~20:30

联系邮箱:

support@epmap.org

联系电话:

021-60534095

服务商简介:

环境保护领域的环境数据服务