Difference between revisions of "通用预报接口/v2.2"

From Caiyun Wiki
Jump to: navigation, search
 
(61 intermediate revisions by 2 users not shown)
Line 7: Line 7:
  
 
<code>
 
<code>
https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/hourly.json
+
<nowiki>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.json</nowiki>
 
</code>
 
</code>
  
Line 15: Line 15:
  
 
=== '''示例1如下''' ===
 
=== '''示例1如下''' ===
<blockquote><code>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/hourly.json</code>
+
<blockquote><code><nowiki>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.json</nowiki></code>
<code>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/hourly.jsonp?callback=MYCALLBACK</code>
+
 
</blockquote><blockquote>'''token:'''这里是测试 token ,即 <code>TAkhjf8d1nlSlspN</code></blockquote><blockquote>'''经纬度:'''经度在前,纬度在后,中间用半角逗号隔开,这里是 <code>121.6544,25.1552</code></blockquote><blockquote>'''返回格式:'''json 或者 jsonp,jsonp 需提供回调函数名</blockquote>
+
</blockquote><blockquote><nowiki>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.jsonp?callback=MYCALLBACK</nowiki></blockquote><blockquote>'''token:'''这里是测试 token ,即 <code>TAkhjf8d1nlSlspN</code></blockquote><blockquote>'''经纬度:'''经度在前,纬度在后,中间用半角逗号隔开,这里是 <code>121.6544,25.1552</code></blockquote><blockquote>'''返回格式:'''json 或者 jsonp,jsonp 需提供回调函数名</blockquote>
  
 
=== '''示例2如下''' ===
 
=== '''示例2如下''' ===
<blockquote><code>[https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/hourly.json?lang=en_US&unit=metric&tzshift=14400 https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/hourly.json?lang=en_US&unit=metric&tzshift=14400&?hourlysteps=2]</code></blockquote><blockquote>'''语言选项 lang:'''(简体中文(zh_CN)、繁体中文(zh_TW)、美式英语(en_US)、英式英语(en_GB))</blockquote><blockquote>'''经纬度附近地址中英文名称:getplacename=True'''</blockquote><blockquote>'''单位制选项 unit:'''(科学单位体系(SI) 、公制(metric)、英制(imperial))、(降水单位:mm/h)</blockquote><blockquote>'''时区偏移秒数:tzshift:'''(例如:印度东5.5区,tzshift=3600*5.5==19800,v2.3之后版本,返回时区信息,使用秒是为了支持像尼泊尔这样的差 5 小时 45 分钟的地区,它们有非整齐的偏移量)</blockquote><blockquote>'''定制返回预报总小时数:hourlysteps''':(例如:未来360小时,未来2小时)</blockquote><blockquote>'''定制返回变量列表:fields=tmp,vis''' 'ast', 'rad', 'prc', 'tmp', 'wnd', 'hmd', 'cld', 'aqi', 'pm25', 'pm25w', 'sky', 'skyh', 'lfi', 'alr', 'pres', 'vis', 'dswrf'</blockquote>
+
<blockquote><code><nowiki>https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather?lang=en_US</nowiki></code></blockquote><blockquote>'''语言选项 lang:'''默认为简体中文(zh_CN)、繁体中文(zh_TW)、美式英语(en_US)、英式英语(en_GB)</blockquote><blockquote>'''单位制选项 unit:'''默认为公制(metric)、科学单位体系(SI) 、英制(imperial)</blockquote><blockquote>'''时区偏移秒数 tzshift:'''用户提供所需时区偏移秒,考虑欧美夏令时,默认东八(tzshift=28800);例如,用户希望取得印度(东5.5区)习惯定义下的逐日天气,加参数&tzshift=19800(=3600*5.5),然后daily的计算都会做相应处理。</blockquote><blockquote>'''定制返回的起始时间戳 begin''':默认为当前utc时间戳,可以用来返回两日内的历史数据</blockquote><blockquote>'''定制返回逐小时预报总小时数 hourlysteps''':默认为48小时(包括当前时刻)</blockquote><blockquote>'''定制返回逐日预报总天数 dailysteps''':默认为5天(包括今天)</blockquote><blockquote>'''返回周围预警: alert='''true (注意小写)</blockquote>
  
==返回结构和说明==
+
=='''返回结构和说明'''==
<syntaxhighlight lang="javascript">
+
<blockquote>'''realtime'''分字段含义,请移步:[http://open.caiyunapp.com/%E5%AE%9E%E5%86%B5%E5%A4%A9%E6%B0%94%E6%8E%A5%E5%8F%A3/v2.2 实况接口/v2.2]</blockquote><blockquote>'''minutely'''分字段含义,请移步:[http://open.caiyunapp.com/%E7%9F%AD%E4%B8%B4%E9%99%8D%E6%B0%B4%E9%A2%84%E6%8A%A5%E6%8E%A5%E5%8F%A3/v2.2 逐分钟降水短临预报接口/v2.2]</blockquote><blockquote>'''hourly'''分字段含义,请移步:[[逐小时预报接口/v2.2]]</blockquote><blockquote>'''daily'''分字段含义,请移步:[[逐日预报接口/v2.2]]</blockquote><blockquote>'''alert'''分字段含义,如下:</blockquote><syntaxhighlight lang="javascript">
  
 
{  status:ok,
 
{  status:ok,
     api_version:v2.2,                                                                                                         // 版本号
+
     api_version:v2.2,
     api_status:active,                                                                                                         // 版本号状态
+
     api_status:active,
     lang:en_US,                                                                                                               // 语言
+
     unit:metric,
     unit:metric,                                                                                                               // 单位制
+
     lang:en_US,
 
     result:{
 
     result:{
         hourly:{
+
         forecast_keypoint:cloudy, clear weather after 23 this midnight,
            status:ok,                                                                                                         // 逐小时预报模块返回状态
+
        primary:0,
            temperature:[{value:23.0,datetime:2018-11-20 10:00},{value:22.0,datetime:2018-11-20 11:00}]},                           // 温度
+
        realtime:{status:ok,                                                                                                ###请参考:实况接口/v2.2
            pres:[{value:100279.8643200001,datetime:2018-11-20 10:00},{value:100249.1918336001,datetime:2018-11-20 11:00}],         // 气压
+
                    temperature:-1.21,
            humidity:[{value:0.77,datetime:2018-11-20 10:00},{value:0.77,datetime:2018-11-20 11:00}],                               // 相对湿度
+
                    pres:56320.24,
            wind:[ {   direction:95.62,                                                                                             // 风向,单位是度。正北方向为0度,顺时针增加到360度。
+
                    humidity:0.09,
                      speed:22.85,datetime:2018-11-20 10:00},                                                                     // 风速,米制下是公里每小时
+
                    wind:{direction:284.91,speed:30.12}},
                  {   direction:97.97,
+
                    precipitation:{local:{status:ok,intensity:0.0,datasource:gfs}},
                      speed:23.27,datetime:2018-11-20 11:00}],
+
                    cloudrate:0.3,
            precipitation:[{value:0.0,datetime:2018-11-20 10:00},{value:0.0,datetime:2018-11-20 11:00}],                           // 本地降水强度
+
                    dswrf:677.9,
            cloudrate:[{value:0.77,datetime:2018-11-20 10:00},{value:0.46,datetime:2018-11-20 11:00}],                             // 云量
+
                    visibility:24.1,
            dswrf:[{value:344.09456384,datetime:2018-11-20 10:00},{value:325.9617024,datetime:2018-11-20 11:00}],                   // 短波辐射
+
                   
            visibility:[{value:23.24,datetime:2018-11-20 10:00},{value:23.0,datetime:2018-11-20 11:00}],                           // 能见度
+
                    skycon:PARTLY_CLOUDY_DAY,
 +
                    ultraviolet:{index:5.0,desc:Moderat},
 +
                    comfort:{index:11,desc:Icy wind cold},
 +
                   
 +
                    pm25:3,
 +
                    pm10:10.0,
 +
                    o3:97.0,
 +
                    no2:2.0,
 +
                    so2:7.0,
 +
                    co:0.4,
 +
                    aqi:10
 +
          },
 +
        minutely:{status:ok,                                                                                                   ###请参考:逐分钟降水短临预报接口/v2.2
 +
                    precipitation_2h:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
 +
                    precipitation:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
 +
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
 +
                    datasource:gfs,
 +
                    description:No snow in the next hour
 +
        },
 +
        hourly:{status:ok,                                                                                                      ###请参考:逐小时预报接口/v2.2
 +
                    description:cloudy, clear weather after 23 this midnight,
 +
                    temperature:[{value:-1.21,datetime:2018-11-20 16:00},{value:-0.51,datetime:2018-11-20 17:00}]},
 +
                    pres:[{value:56320.2411405722,datetime:2018-11-20 16:00},{value:56309.4272949293,datetime:2018-11-20 17:00}],
 +
                    humidity:[{value:0.09,datetime:2018-11-20 16:00},{value:0.11,datetime:2018-11-20 17:00}],
 +
                    wind:[{direction:284.91,speed:30.12,datetime:2018-11-20 16:00},{direction:288.24,speed:32.91,datetime:2018-11-20 17:00}],
 +
                    precipitation:[{value:0.0,datetime:2018-11-20 16:00},{value:0.0,datetime:2018-11-20 17:00}],
 +
                    cloudrate:[{value:0.3,datetime:2018-11-20 16:00},{value:0.3,datetime:2018-11-20 17:00}],
 +
                    dswrf:[{value:677.9121814107,datetime:2018-11-20 16:00},{value:596.25984,datetime:2018-11-20 17:00}],
 +
                    visibility:[{value:24.1,datetime:2018-11-20 16:00},{value:24.1,datetime:2018-11-20 17:00}],
 +
 
 +
                    skycon:[{value:PARTLY_CLOUDY_DAY,datetime:2018-11-20 16:00},{value:WIND,datetime:2018-11-20 17:00}],
 +
                    pm25:[{value:3,datetime:2018-11-20 16:00},{value:0,datetime:2018-11-20 17:00}],
 +
                    aqi:[{value:10,datetime:2018-11-20 16:00},{value:0,datetime:2018-11-20 17:00}],
 +
            },
 +
        daily:{status:ok,                                                                                                      ###请参考:逐日预报接口/v2.2
 +
                temperature:[{date:2018-11-20,max:1.19,avg:-4.35,min:-16.0},{date:2018-11-21,max:2.0,avg:-7.32,min:-18.0}],
 +
                pres:[{date:2018-11-20,max:56600.24,avg:56422.06,min:56309.43},{date:2018-11-21,max:56833.63,avg:56653.05,min:56553.63}],
 +
                humidity:[{date:2018-11-20,max:0.23,avg:0.14,min:0.09},{date:2018-11-21,max:0.15,avg:0.11,min:0.06}],
 +
                wind:[{date:2018-11-20,max:{direction:290.25,speed:35.9},avg:{direction:278.27,speed:19.65},min:{direction:230.17,speed:4.77}},
 +
                      {date:2018-11-21,max:{direction:276.13,speed:43.0},avg:{direction:262.47,speed:24.54},min:{direction:216.1,speed:12.48}}],
 +
                precipitation:[{date:2018-11-20,max:0.0,avg:0.0,min:0.0},{date:2018-11-21,max:0.0,avg:0.0,min:0.0}],
 +
               
 +
                dswrf:[{date:2018-11-20,max:743.7,avg:321.5,min:0.0},{date:2018-11-21,max:748.3,avg:202.3,min:0.0}],
 +
                cloudrate:[{date:2018-11-20,max:0.76,avg:0.49,min:0.0},{date:2018-11-21,max:0.15,avg:0.02,min:0.0}],
 +
                visibility:[{date:2018-11-20,max:24.1,avg:24.1,min:24.1},{date:2018-11-21,max:24.1,avg:24.1,min:24.1}],
 +
               
 +
                skycon:[{date:2018-11-20,value:PARTLY_CLOUDY_DAY},{date:2018-11-21,value:CLEAR_DAY}],
 +
                skycon_08h_20h:[{date:2018-11-20,value:CLEAR_DAY},{date:2018-11-21,value:CLEAR_DAY}]},
 +
                skycon_20h_32h:[{date:2018-11-20,value:PARTLY_CLOUDY_NIGHT},{date:2018-11-21,value:CLEAR_NIGHT}],
 +
                ultraviolet:[{index:5,desc:Very high,datetime:2018-11-20},{index:5,desc:Very high,datetime:2018-11-21}],
 +
                comfort:[{index:13,desc:Dry cold,datetime:2018-11-20},{index:13,desc:Dry cold,datetime:2018-11-21}],
 +
                carWashing:[{index:1,desc:Suitable,datetime:2018-11-20},{index:1,desc:Suitable,datetime:2018-11-21}],
 +
                coldRisk:[{index:4,desc:Extremely prone,datetime:2018-11-20},{index:4,desc:Extremely prone,datetime:2018-11-21}],
 +
                dressing:[{index:8,desc:Extremely cold,datetime:2018-11-20},{index:8,desc:Extremely cold,datetime:2018-11-21}],
 +
               
 +
                pm25:[{date:2018-11-20,max:3,avg:1.12,min:0},{date:2018-11-21,max:1,avg:0.58,min:0}],
 +
                aqi:[{date:2018-11-20,max:10,avg:1.25,min:0},{date:2018-11-21,max:0,avg:0.0,min:0}],
  
            skycon:[{value:PARTLY_CLOUDY_DAY,datetime:2018-11-20 10:00},{value:PARTLY_CLOUDY_DAY,datetime:2018-11-20 11:00}],       // 主要天气现象
+
                astro:[{date:2018-11-20,sunset:{time:19:07},sunrise:{time:08:40}},{date:2018-11-21,sunset:{time:19:07},sunrise:{time:08:41}}],
            description:cloudy, clear weather after 7 tomorrow morning, increasing cloudiness,                                      // 逐小时天气预报,自然语言描述
+
        },
            forecast_keypoint:cloudy, clear weather after 7 tomorrow morning, increasing cloudiness,primary:0,                    // 逐小时和逐分钟天气预报,综合自然语言描述
+
      alert:{alert:{status:"ok"
 +
              content:{
 +
                    0:{ request_status: "ok",
 +
                        source: "国家预警信息发布中心",
  
            pm25:[{value:8,datetime:2018-11-20 10:00},{value:9,datetime:2018-11-20 11:00}],                                        // PM2.5
+
                        county: "无",
            aqi:[{value:33,datetime:2018-11-20 10:00},{value:13,datetime:2018-11-20 11:00}]                                        // AQI(国标)
+
                        province: "江苏省",
            },
+
                        regionId: "unknown"
    location:[25.1552,
+
                        city: "南京市",
              121.6544]                                                                                                            // 经纬度
+
                        code: "1303",                                                       ##预警类型code
    placename:Unnamed Road, Wanli District, New Taipei City, Taiwan 207,                                                        // 经纬度处地址
+
                        adcode: "320100",
    server_time:1542695724,                                                                                                     // 服务器本次返回的utc时间戳
 
    tzshift:14400,                                                                                                             // 时区的偏移秒数,如东八区就是 28800 秒
 
}
 
  
</syntaxhighlight>
+
                        alertId: "32010041600000_20181130104521",
 +
                        status: "预警中",
 +
                        title: "南京市气象台发布霾橙色预警[Ⅱ级/严重]",
 +
                        description: "南京市气象台2018年11月30日10时41分升级霾黄色预警信号为霾橙色预警信号。目前我市已经出现中度霾,预计未来24小时内霾将持续,请注意防范。"
  
=='''变量说明'''==
+
                        location: "江苏省南京市",
<blockquote>逐小时预报,没有生活指数变量</blockquote>
+
                        latlon: {
{| class="wikitable"
+
                            0: 32.060255,
! 名称
+
                            1: 118.796877
! 健值路径(jsonpath) !! 量 !! 时间粒度 !! 地理范围 !! 注释
+
                            }
|-
+
                        pubtimestamp: 1543545921,
! 温度
+
                        }
| $.result.hourly.temperature.value || 温度 || 逐小时预报 || 全球 || 地表2米气温
+
                    }
|-
+
              }
! 气压
+
      },
| $.result.hourly.pres.value || 气压(Pa) || 逐小时预报 || 全球 || 地面气压
+
    location:[31.658613,
|-
+
                87.815109]
! 相对湿度
+
    server_time:1542702509,
| $.result.hourly.humidity.value || 相对湿度(%) || 逐小时预报 || 全球 || 地表2米湿度
+
    tzshift:28800,
|-
+
}
! 风向
 
| $.result.hourly.wind.direction.value || 风向 || 逐小时预报 || 全球 || 地表10米风向
 
|-
 
! 风速
 
| $.result.hourly.wind.speed.value || 风速 || 逐小时预报 || 全球 || 地表10米风速
 
|-
 
! 本地降水强度
 
| $.result.hourly.precipitation.value || 降水强度 || 逐小时预报 || 全球 || 本地降水强度
 
|-
 
! 云量
 
| $.result.hourly.cloudrate.value || 云量(0.0-1.0) || 逐小时预报 || 全球 || 全天总云量
 
|-
 
! 短波辐射
 
| $.result.hourly.dswrf.value|| 向下短波辐射通量(W/M2) || 逐小时预报 || 全球 || 地表向下短波辐射通量
 
|-
 
! 能见度
 
| $.result.hourly.visibility.value || 能见度 || 逐小时预报 || 全球 || 地表水平能见度
 
|-
 
!
 
!
 
!
 
!
 
!
 
!
 
|-
 
! 主要天气现象
 
| $.result.hourly.skycon.value || 天气状况 || 逐小时预报 || 全球 || 天气状况
 
|-
 
! 逐小时预报自然语言描述
 
| $.result.hourly.description || 舒适度指数自然语言 || 逐小时预报 || 全球 || 舒适度指数及其描述
 
|-
 
! 综合预报自然语言描述
 
| $.result.hourly.forecast_keypoint || 紫外线指数自然语言 || 逐小时预报 || 全球 || 逐小时和逐分钟天气预报,综合自然语言描述
 
|-
 
!
 
!
 
!
 
!
 
!
 
!
 
|-
 
! PM25浓度
 
| $.result.hourly.pm25.value || PM25浓度(μg/m3) || 逐小时预报 || 大陆、港澳台、暂无印度 || PM25浓度
 
|-
 
! AQI
 
| $.result.hourly.aqi.value || 国标AQI || 逐小时预报 || 大陆、港澳台、暂无印度 || 国标AQI
 
|}
 
  
==天气现象==
+
</syntaxhighlight>{{预警类型}}{{天气现象}}
  
{| class="wikitable"
+
=='''生活指数'''==
| 天气现象
+
{{生活指数}}
! 代码
 
|-
 
|晴(白天)
 
|CLEAR_DAY
 
|-
 
|晴(夜间)
 
|CLEAR_NIGHT
 
|-
 
|多云(白天)
 
|PARTLY_CLOUDY_DAY
 
|-
 
|多云(夜间)
 
|PARTLY_CLOUDY_NIGHT
 
|-
 
|阴
 
|CLOUDY
 
|-
 
|大风
 
|WIND
 
|-
 
|雾霾
 
|HAZE
 
|-
 
|雨
 
|RAIN
 
|-
 
|雪
 
|SNOW
 
|}
 
  
==支持的单位制==
+
=='''支持的单位制'''==
  
 
{{Template:彩云天气 API/支持的单位制}}
 
{{Template:彩云天气 API/支持的单位制}}
 +
 +
[[Category:API 产品]]

Latest revision as of 10:12, 20 May 2019

本文版本:通用预报接口/v2.2,当前稳定版本版本:v2.5,历史版本:v2.2v2.3,和 v2.4

授权与认证

请先至彩云开放平台注册,注册后可以获得 token 。

把您的 token 拼到 API 请求的 URL 中,如

https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.json

其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人!

请求样例

示例1如下

https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.json
https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather.jsonp?callback=MYCALLBACK
token:这里是测试 token ,即 TAkhjf8d1nlSlspN
经纬度:经度在前,纬度在后,中间用半角逗号隔开,这里是 121.6544,25.1552
返回格式:json 或者 jsonp,jsonp 需提供回调函数名

示例2如下

https://api.caiyunapp.com/v2/TAkhjf8d1nlSlspN/121.6544,25.1552/weather?lang=en_US
语言选项 lang:默认为简体中文(zh_CN)、繁体中文(zh_TW)、美式英语(en_US)、英式英语(en_GB)
单位制选项 unit:默认为公制(metric)、科学单位体系(SI) 、英制(imperial)
时区偏移秒数 tzshift:用户提供所需时区偏移秒,考虑欧美夏令时,默认东八(tzshift=28800);例如,用户希望取得印度(东5.5区)习惯定义下的逐日天气,加参数&tzshift=19800(=3600*5.5),然后daily的计算都会做相应处理。
定制返回的起始时间戳 begin:默认为当前utc时间戳,可以用来返回两日内的历史数据
定制返回逐小时预报总小时数 hourlysteps:默认为48小时(包括当前时刻)
定制返回逐日预报总天数 dailysteps:默认为5天(包括今天)
返回周围预警: alert=true (注意小写)

返回结构和说明

realtime分字段含义,请移步:实况接口/v2.2
minutely分字段含义,请移步:逐分钟降水短临预报接口/v2.2
hourly分字段含义,请移步:逐小时预报接口/v2.2
daily分字段含义,请移步:逐日预报接口/v2.2
alert分字段含义,如下:
{   status:ok,
    api_version:v2.2,
    api_status:active,
    unit:metric,
    lang:en_US,
    result:{
        forecast_keypoint:cloudy, clear weather after 23 this midnight,
        primary:0,
        realtime:{status:ok,                                                                                                 ###请参考实况接口/v2.2
                    temperature:-1.21,
                    pres:56320.24,
                    humidity:0.09,
                    wind:{direction:284.91,speed:30.12}},
                    precipitation:{local:{status:ok,intensity:0.0,datasource:gfs}},
                    cloudrate:0.3,
                    dswrf:677.9,
                    visibility:24.1,
                    
                    skycon:PARTLY_CLOUDY_DAY,
                    ultraviolet:{index:5.0,desc:Moderat},
                    comfort:{index:11,desc:Icy wind cold},
                    
                    pm25:3,
                    pm10:10.0,
                    o3:97.0,
                    no2:2.0,
                    so2:7.0,
                    co:0.4,
                    aqi:10
           },
        minutely:{status:ok,                                                                                                   ###请参考逐分钟降水短临预报接口/v2.2
                    precipitation_2h:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
                    precipitation:[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
                    0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
                    datasource:gfs,
                    description:No snow in the next hour
         },
        hourly:{status:ok,                                                                                                      ###请参考逐小时预报接口/v2.2
                    description:cloudy, clear weather after 23 this midnight,
                    temperature:[{value:-1.21,datetime:2018-11-20 16:00},{value:-0.51,datetime:2018-11-20 17:00}]},
                    pres:[{value:56320.2411405722,datetime:2018-11-20 16:00},{value:56309.4272949293,datetime:2018-11-20 17:00}],
                    humidity:[{value:0.09,datetime:2018-11-20 16:00},{value:0.11,datetime:2018-11-20 17:00}],
                    wind:[{direction:284.91,speed:30.12,datetime:2018-11-20 16:00},{direction:288.24,speed:32.91,datetime:2018-11-20 17:00}],
                    precipitation:[{value:0.0,datetime:2018-11-20 16:00},{value:0.0,datetime:2018-11-20 17:00}],
                    cloudrate:[{value:0.3,datetime:2018-11-20 16:00},{value:0.3,datetime:2018-11-20 17:00}],
                    dswrf:[{value:677.9121814107,datetime:2018-11-20 16:00},{value:596.25984,datetime:2018-11-20 17:00}],
                    visibility:[{value:24.1,datetime:2018-11-20 16:00},{value:24.1,datetime:2018-11-20 17:00}],

                    skycon:[{value:PARTLY_CLOUDY_DAY,datetime:2018-11-20 16:00},{value:WIND,datetime:2018-11-20 17:00}],
                    pm25:[{value:3,datetime:2018-11-20 16:00},{value:0,datetime:2018-11-20 17:00}],
                    aqi:[{value:10,datetime:2018-11-20 16:00},{value:0,datetime:2018-11-20 17:00}],
            },
        daily:{status:ok,                                                                                                      ###请参考逐日预报接口/v2.2
                temperature:[{date:2018-11-20,max:1.19,avg:-4.35,min:-16.0},{date:2018-11-21,max:2.0,avg:-7.32,min:-18.0}],
                pres:[{date:2018-11-20,max:56600.24,avg:56422.06,min:56309.43},{date:2018-11-21,max:56833.63,avg:56653.05,min:56553.63}],
                humidity:[{date:2018-11-20,max:0.23,avg:0.14,min:0.09},{date:2018-11-21,max:0.15,avg:0.11,min:0.06}],
                wind:[{date:2018-11-20,max:{direction:290.25,speed:35.9},avg:{direction:278.27,speed:19.65},min:{direction:230.17,speed:4.77}},
                      {date:2018-11-21,max:{direction:276.13,speed:43.0},avg:{direction:262.47,speed:24.54},min:{direction:216.1,speed:12.48}}],
                precipitation:[{date:2018-11-20,max:0.0,avg:0.0,min:0.0},{date:2018-11-21,max:0.0,avg:0.0,min:0.0}],
                
                dswrf:[{date:2018-11-20,max:743.7,avg:321.5,min:0.0},{date:2018-11-21,max:748.3,avg:202.3,min:0.0}],
                cloudrate:[{date:2018-11-20,max:0.76,avg:0.49,min:0.0},{date:2018-11-21,max:0.15,avg:0.02,min:0.0}],
                visibility:[{date:2018-11-20,max:24.1,avg:24.1,min:24.1},{date:2018-11-21,max:24.1,avg:24.1,min:24.1}],
                
                skycon:[{date:2018-11-20,value:PARTLY_CLOUDY_DAY},{date:2018-11-21,value:CLEAR_DAY}],
                skycon_08h_20h:[{date:2018-11-20,value:CLEAR_DAY},{date:2018-11-21,value:CLEAR_DAY}]},
                skycon_20h_32h:[{date:2018-11-20,value:PARTLY_CLOUDY_NIGHT},{date:2018-11-21,value:CLEAR_NIGHT}],
                ultraviolet:[{index:5,desc:Very high,datetime:2018-11-20},{index:5,desc:Very high,datetime:2018-11-21}],
                comfort:[{index:13,desc:Dry cold,datetime:2018-11-20},{index:13,desc:Dry cold,datetime:2018-11-21}],
                carWashing:[{index:1,desc:Suitable,datetime:2018-11-20},{index:1,desc:Suitable,datetime:2018-11-21}],
                coldRisk:[{index:4,desc:Extremely prone,datetime:2018-11-20},{index:4,desc:Extremely prone,datetime:2018-11-21}],
                dressing:[{index:8,desc:Extremely cold,datetime:2018-11-20},{index:8,desc:Extremely cold,datetime:2018-11-21}],
                
                pm25:[{date:2018-11-20,max:3,avg:1.12,min:0},{date:2018-11-21,max:1,avg:0.58,min:0}],
                aqi:[{date:2018-11-20,max:10,avg:1.25,min:0},{date:2018-11-21,max:0,avg:0.0,min:0}],

                astro:[{date:2018-11-20,sunset:{time:19:07},sunrise:{time:08:40}},{date:2018-11-21,sunset:{time:19:07},sunrise:{time:08:41}}],
        },
       alert:{alert:{status:"ok"
              content:{
                    0:{ request_status: "ok",
                        source: "国家预警信息发布中心",

                        county: "无",
                        province: "江苏省",
                        regionId: "unknown"
                        city: "南京市",
                        code: "1303",                                                       ##预警类型code
                        adcode: "320100",

                        alertId: "32010041600000_20181130104521",
                        status: "预警中",
                        title: "南京市气象台发布霾橙色预警[Ⅱ级/严重]",
                        description: "南京市气象台2018年11月30日10时41分升级霾黄色预警信号为霾橙色预警信号。目前我市已经出现中度霾,预计未来24小时内霾将持续,请注意防范。"

                        location: "江苏省南京市",
                        latlon: {
                            0: 32.060255,
                            1: 118.796877
                            }
                        pubtimestamp: 1543545921,
                        }
                    }
              }
      },
    location:[31.658613,
                87.815109]
    server_time:1542702509,
    tzshift:28800,
}
==预警类型==

预警code字段,格式为AABB:

AA取01-16,分别表示:台风、暴雨、暴雪、寒潮、大风、沙尘暴、高温、干旱、雷电、冰雹、霜冻、大雾、霾、道路结冰、森林火灾、雷雨大风,

BB取01-04,分别表示:蓝色、黄色、橙色、红色。

code 预警类型
01BB 台风
02BB 暴雨
03BB 暴雪
04BB 寒潮
05BB 大风
06BB 沙尘暴
07BB 高温
08BB 干旱
09BB 雷电
10BB 冰雹
11BB 霜冻
12BB 大雾
13BB
14BB 道路结冰
15BB 森林火灾
16BB 雷雨大风


暴雪预警信号

http://www.12379.cn/html/ggaq/yjzn/yjxh/2013/01/78327.shtml==天气现象 skycon v2.5==

主要天气现象的优先级:冰雹 > 雷阵雨 > 降雪 > 降雨 > 雾 > 沙尘 > 浮尘 > 雾霾 > 大风 > 阴 > 多云 > 晴

天气现象 代码 备注
晴(白天) CLEAR_DAY cloudrate < 0.2
晴(夜间) CLEAR_NIGHT cloudrate < 0.2
多云(白天) PARTLY_CLOUDY_DAY 0.8 >= cloudrate > 0.2
多云(夜间) PARTLY_CLOUDY_NIGHT 0.8 >= cloudrate > 0.2
CLOUDY cloudrate > 0.8
轻度雾霾 LIGHT_HAZE PM2.5 100~150
中度雾霾 MODERATE_HAZE PM2.5 150~200
重度雾霾 HEAVY_HAZE PM2.5 > 200
小雨 LIGHT_RAIN
中雨 MODERATE_RAIN
大雨 HEAVY_RAIN
暴雨 STORM_RAIN
FOG 能见度低,湿度高,风速低,温度低
小雪 LIGHT_SNOW
中雪 MODERATE_SNOW
大雪 HEAVY_SNOW
暴雪 STORM_SNOW
浮尘 DUST aqi > 150,pm10 > 150,湿度 < 30%,风速 < 6 m/s
沙尘 SAND aqi > 150,pm10 > 150,湿度 < 30%,风速 > 6 m/s
大风 WIND
雷阵雨 THUNDER_SHOWER 闪电+降水
冰雹 HAIL 闪电+降水+其他
雨夹雪 SLEET



雾霾类(HAZE)天气现象(skycon)分三个等级:

轻度雾霾 中度雾霾 重度雾霾
AQI > 100 AQI > 150 AQI > 200

空气污染的自然语言描述air_quality: description字段,根据AQI有六个等级划分:

缺数据 missing 优 good 良 satisfactory 轻度污染 moderate 中度污染 unhealthy 重度污染 very poor 严重污染 hazardous
无测站国家和位置 0~50 51~100 101~150 151~200 201~300 >300

生活指数

1.目前支持的生活指数(life_index)包括:紫外线(ultraviolet)、舒适度(comfort)、洗车(carWashing)、感冒(coldRisk)、(穿衣指数(dressing),不建议继续使用,请使用舒适度):


紫外线(ultraviolet)实况
level desc 自然语言描述
0 None 无(夜间)
1 Weak 很弱
2 Weak 很弱
3 Low
4 Low
5 Moderate 中等
6 Moderate 中等
7 High
8 High
9 Very High 很强
10 Very High 很强
11 Extreme 极强
紫外线(ultraviolet)逐日预报(午间时段,10:00AM~14:00PM)
level desc 自然语言描述
0 None 无(夜间)
1 Weak 最弱
2 Low
3 Moderate 中等
4 High
5 Very high 很强
舒适度(comfort)实况和逐日预报
level desc 自然语言描述
0 Sticky 闷热
1 Extremely hot 酷热
2 Very hot 很热
3 Hot
4 Warm 温暖
5 Comfort 舒适
6 Cool 凉爽
7 Cold
8 Very cold 很冷
9 Freezing 寒冷
10 Frigid 极冷
11 Icy 刺骨的冷
12 Clammy 湿冷
13 Dry cold 干冷
洗车(carWashing)逐日预报
level desc 自然语言描述
1 Suitable 适宜
2 More appropriate 较适宜
3 Less appropriate 较不适宜
4 Unfit 不适应
感冒(coldRisk)逐日预报
level desc 自然语言描述
1 Less prone 少发
2 Easily prone 较易发
3 Prone 易发
4 Extremely prone 极易发

支持的单位制

1.目前支持的单位制包括:科学单位体系(SI,大写)、英制(imperial)、公制(不带参数&unit默认公制,公制还包括: metric:v1和metric:v2):

单位制
要素
SI(科学单位体系) imperial(英制) metric:v1(公制v1) metric:v2(公制v2) default metric(默认公制)
实况降水量 米/秒(meter/sec) 英寸/小时(in/hr) 雷达降水强度(0~1) 毫米/小时(mm/hr) 雷达降水强度(0~1)
逐分钟降水短临预报降水量 米/秒(meter/sec) 英寸/小时(in/hr) 雷达降水强度(0~1) 毫米/小时(mm/hr) 雷达降水强度(0~1)
逐小时预报降水量 米/秒(meter/sec) 英寸/小时(in/hr) 雷达降水强度(0~1) 毫米/小时(mm/hr) 毫米/小时(mm/hr)
逐日预报降水量 米/秒(meter/sec) 英寸/小时(in/hr) 雷达降水强度(0~1) 毫米/小时(mm/hr) 毫米/小时(mm/hr)
距离 米(m) 英里(mi) 公里(km) 公里(km) 公里(km)
温度 开尔文(K) 华氏度(℉) 摄氏度(℃) 摄氏度(℃) 摄氏度(℃)
气压 帕(Pa) 帕(Pa) 帕(Pa) 帕(Pa) 帕(Pa)
相对湿度 0~1 0~1 0~1 0~1 0~1
风向 从北顺时针(0~360°) 从北顺时针(0~360°) 从北顺时针(0~360°) 从北顺时针(0~360°) 从北顺时针(0~360°)
风速 米/秒(m/s) 英里/小时(mi/hr) 公里/小时(km/hr) 公里/小时(km/hr) 公里/小时(km/hr)
云量 0~1 0~1 0~1 0~1 0~1
能见度 米(m) 英里(mi) 公里(km) 公里(km) 公里(km)

unit=metric:v1时,所有类型中precipitation的单位都是:雷达降水强度(0~1)

unit=metric:v2时,所有类型中precipitation的单位都是:毫米/小时(mm/hr)

2.判断降水等级:

  • 带参数&unit=metric:v1,请求实况、分钟级、逐小时和逐日降水强度,单位都为雷达降水强度(0 ~ 1);
  • 雷达降水强度(0 ~ 1)判断降水等级:0.03~0.25 小雨(雪), 0.25~0.35 中雨(雪), 0.35~0.48大雨(雪), >0.48 暴雨(雪);
  • v2.4版本中,本地存在降水时,可以根据skycon(存在于realtime、hourly、daily字段),和skycon_08h_20h和skycon_20h_32h(存在于daily字段),中的:LIGHT_RAIN, MODERATE_RAIN, HEAVY_RAIN, STORM_RAIN(LIGHT_SNOW, MODERATE_SNOW, HEAVY_SNOW,STORM_SNOW)直接获取降水等级
  • 大暴雨(雪)和特大暴雨(雪),需要根据24小时累计公制降水量(mm/24hr)来判断,研发中...