码迷,mamicode.com
首页 > Windows程序 > 详细

天气预报API(三):免费接口测试(“旧编码”)

时间:2016-12-10 14:02:21      阅读:3874      评论:0      收藏:0      [点我收藏+]

标签:lan   name   整理   poll   也有   tao   oda   参考   shu   

说明

我以参考文章为引子,自己测试并扩展,努力寻找更多的气象API...

本文所有测试均以青岛为例。
本文所列接口城市代码(cityid)参数都使用的 “旧编码”全国城市代码列表(旧)全球城市、景点代码

注:另有 “新编码” 的介绍和使用,详见: 全国城市代码列表(新)

1. 国家气象局

  • 当天基础天气接口
    http://www.weather.com.cn/data/sk/101120201.html


    1. "weatherinfo": { 
    2. "city": "青岛", 
    3. "cityid": "101120201",//城市代码  
    4. "temp": "5", //当前温度  
    5. "WD": "南风", //风向  
    6. "WS": "3级", //风速  
    7. "SD": "84%", //相对湿度 
    8. "WSE": "3", //风力 
    9. "time": "17:05", //更新时间  
    10. "isRadar": "1", //是否有雷达图(1表示有雷达图) 
    11. "Radar": "JC_RADAR_AZ9532_JB", //雷达图地址(AZ9532为青岛雷达) 
    12. "njd": "暂无实况", 
    13. "qy": "1009", 
    14. "rain": "0" 
    15. } 

  • 当天基础天气接口
    http://www.weather.com.cn/data/cityinfo/101120201.html


    1. "weatherinfo": { 
    2. "city": "青岛", 
    3. "cityid": "101120201", 
    4. "temp1": "3℃", 
    5. "temp2": "8℃", 
    6. "weather": "晴转多云", 
    7. "img1": "n0.gif", 
    8. "img2": "d1.gif", 
    9. "ptime": "18:00" 
    10. } 

    图片的使用:http://m.weather.com.cn/img/d0.gif <=> 技术分享

  • 省会城市基础天气接口,返回xml格式
    http://flash.weather.com.cn/wmaps/xml/china.xml

    1. <china dn="nay"> 
    2. <city quName="黑龙江" pyName="heilongjiang" cityname="哈尔滨" state1="14" state2="1" stateDetailed="小雪转多云" tem1="-21" tem2="-11" windState="微风转西北风小于3级"/> 
    3. <city quName="吉林" pyName="jilin" cityname="长春" state1="1" state2="0" stateDetailed="多云转晴" tem1="-14" tem2="-7" windState="微风"/> 
    4. <city quName="辽宁" pyName="liaoning" cityname="沈阳" state1="1" state2="0" stateDetailed="多云转晴" tem1="-13" tem2="-4" windState="北风4-5级转微风"/> 
    5. <city quName="海南" pyName="hainan" cityname="海口" state1="1" state2="1" stateDetailed="多云" tem1="16" tem2="24" windState="东北风3-4级"/> 
    6. <city quName="内蒙古" pyName="neimenggu" cityname="呼和浩特" state1="0" state2="1" stateDetailed="晴转多云" tem1="-12" tem2="0" windState="微风"/> 
    7. <city quName="新疆" pyName="xinjiang" cityname="乌鲁木齐" state1="1" state2="1" stateDetailed="多云" tem1="-4" tem2="4" windState="微风"/> 
    8. <city quName="西藏" pyName="xizang" cityname="拉萨" state1="0" state2="0" stateDetailed="晴" tem1="-3" tem2="12" windState="微风"/> 
    9. <city quName="青海" pyName="qinghai" cityname="西宁" state1="0" state2="1" stateDetailed="晴转多云" tem1="-9" tem2="12" windState="东南风小于3级"/> 
    10. <city quName="宁夏" pyName="ningxia" cityname="银川" state1="1" state2="1" stateDetailed="多云" tem1="-5" tem2="5" windState="微风"/> 
    11. <city quName="甘肃" pyName="gansu" cityname="兰州" state1="0" state2="1" stateDetailed="晴转多云" tem1="-3" tem2="8" windState="微风"/> 
    12. <city quName="河北" pyName="hebei" cityname="石家庄" state1="0" state2="1" stateDetailed="晴转多云" tem1="-2" tem2="6" windState="微风"/> 
    13. <city quName="河南" pyName="henan" cityname="郑州" state1="0" state2="1" stateDetailed="晴转多云" tem1="2" tem2="10" windState="微风"/> 
    14. <city quName="湖北" pyName="hubei" cityname="武汉" state1="0" state2="0" stateDetailed="晴" tem1="3" tem2="16" windState="微风"/> 
    15. <city quName="湖南" pyName="hunan" cityname="长沙" state1="0" state2="0" stateDetailed="晴" tem1="7" tem2="20" windState="微风"/> 
    16. <city quName="山东" pyName="shandong" cityname="济南" state1="0" state2="1" stateDetailed="晴转多云" tem1="-1" tem2="7" windState="北风3-4级转微风"/> 
    17. <city quName="江苏" pyName="jiangsu" cityname="南京" state1="0" state2="1" stateDetailed="晴转多云" tem1="5" tem2="13" windState="北风转东北风3-4级"/> 
    18. <city quName="安徽" pyName="anhui" cityname="合肥" state1="0" state2="1" stateDetailed="晴转多云" tem1="6" tem2="14" windState="东北风3-4级"/> 
    19. <city quName="山西" pyName="shanxi" cityname="太原" state1="0" state2="1" stateDetailed="晴转多云" tem1="-6" tem2="8" windState="西北风3-4级转微风"/> 
    20. <city quName="陕西" pyName="sanxi" cityname="西安" state1="53" state2="53" stateDetailed="霾" tem1="1" tem2="10" windState="东北风小于3级"/> 
    21. <city quName="四川" pyName="sichuan" cityname="成都" state1="1" state2="2" stateDetailed="多云转阴" tem1="6" tem2="14" windState="南风小于3级"/> 
    22. <city quName="云南" pyName="yunnan" cityname="昆明" state1="0" state2="0" stateDetailed="晴" tem1="3" tem2="19" windState="微风"/> 
    23. <city quName="贵州" pyName="guizhou" cityname="贵阳" state1="0" state2="0" stateDetailed="晴" tem1="6" tem2="18" windState="南风小于3级"/> 
    24. <city quName="浙江" pyName="zhejiang" cityname="杭州" state1="0" state2="0" stateDetailed="晴" tem1="7" tem2="15" windState="东北风小于3级"/> 
    25. <city quName="福建" pyName="fujian" cityname="福州" state1="0" state2="0" stateDetailed="晴" tem1="10" tem2="20" windState="微风转东北风小于3级"/> 
    26. <city quName="江西" pyName="jiangxi" cityname="南昌" state1="18" state2="0" stateDetailed="雾转晴" tem1="6" tem2="17" windState="微风"/> 
    27. <city quName="广东" pyName="guangdong" cityname="广州" state1="0" state2="0" stateDetailed="晴" tem1="12" tem2="24" windState="微风"/> 
    28. <city quName="广西" pyName="guangxi" cityname="南宁" state1="0" state2="0" stateDetailed="晴" tem1="14" tem2="26" windState="东北风小于3级"/> 
    29. <city quName="北京" pyName="beijing" cityname="北京" state1="0" state2="0" stateDetailed="晴" tem1="-2" tem2="4" windState="北风3-4级转南风小于3级"/> 
    30. <city quName="天津" pyName="tianjin" cityname="天津" state1="0" state2="0" stateDetailed="晴" tem1="-2" tem2="6" windState="西北风4-5级转北风小于3级"/> 
    31. <city quName="上海" pyName="shanghai" cityname="上海" state1="0" state2="1" stateDetailed="晴转多云" tem1="8" tem2="14" windState="南风小于3级转微风"/> 
    32. <city quName="重庆" pyName="chongqing" cityname="重庆" state1="1" state2="1" stateDetailed="多云" tem1="9" tem2="17" windState="微风"/> 
    33. <city quName="香港" pyName="xianggang" cityname="香港" state1="1" state2="1" stateDetailed="多云" tem1="17" tem2="22" windState="微风"/> 
    34. <city quName="澳门" pyName="aomen" cityname="澳门" state1="0" state2="0" stateDetailed="晴" tem1="16" tem2="23" windState="微风"/> 
    35. <city quName="台湾" pyName="taiwan" cityname="台北" state1="7" state2="7" stateDetailed="小雨" tem1="18" tem2="22" windState="微风"/> 
    36. <city quName="西沙" pyName="xisha" cityname="西沙" state1="3" state2="3" stateDetailed="阵雨" tem1="24" tem2="28" windState="东北风4-5级"/> 
    37. <city quName="南沙" pyName="nanshadao" cityname="南沙" state1="3" state2="3" stateDetailed="阵雨" tem1="27" tem2="30" windState="东北风4-5级"/> 
    38. <city quName="钓鱼岛" pyName="diaoyudao" cityname="钓鱼岛" state1="2" state2="7" stateDetailed="阴转小雨" tem1="19" tem2="21" windState="东北风4-5级"/> 
    39. </china> 
  • SmartWeatherAPI平台提供丰富的气象服务信息,包括预报、指数、预警、资讯、雷达、云图、农历以及服务产品等内容。

  • http://www.weather.com.cn/data/zs/101010100.html(已失效)

2. 中华万年历

  • 城市id或名称获得天气数据,json数据
    http://wthrcdn.etouch.cn/weather_mini?citykey=101120201
    http://wthrcdn.etouch.cn/weather_mini?city=青岛


    1. "desc": "OK"
    2. "status": 1000
    3. "data": { 
    4. "wendu": "4", 
    5. "ganmao": "将有一次强降温过程,且风力较强,极易发生感冒,请特别注意增加衣服保暖防寒。", 
    6. "forecast": [ 
    7. { 
    8. "fengxiang": "北风", 
    9. "fengli": "4-5级", 
    10. "high": "高温 6℃", 
    11. "type": "晴", 
    12. "low": "低温 0℃", 
    13. "date": "9日星期五" 
    14. }, 
    15. { 
    16. "fengxiang": "北风", 
    17. "fengli": "3-4级", 
    18. "high": "高温 7℃", 
    19. "type": "晴", 
    20. "low": "低温 2℃", 
    21. "date": "10日星期六" 
    22. }, 
    23. { 
    24. "fengxiang": "北风", 
    25. "fengli": "3-4级", 
    26. "high": "高温 9℃", 
    27. "type": "晴", 
    28. "low": "低温 4℃", 
    29. "date": "11日星期天" 
    30. }, 
    31. { 
    32. "fengxiang": "南风", 
    33. "fengli": "3-4级", 
    34. "high": "高温 8℃", 
    35. "type": "阵雨", 
    36. "low": "低温 1℃", 
    37. "date": "12日星期一" 
    38. }, 
    39. { 
    40. "fengxiang": "北风", 
    41. "fengli": "5-6级", 
    42. "high": "高温 6℃", 
    43. "type": "晴", 
    44. "low": "低温 -1℃", 
    45. "date": "13日星期二" 
    46. } 
    47. ], 
    48. "yesterday": { 
    49. "fl": "5-6级", 
    50. "fx": "南风", 
    51. "high": "高温 11℃", 
    52. "type": "多云", 
    53. "low": "低温 2℃", 
    54. "date": "8日星期四" 
    55. }, 
    56. "aqi": "51", 
    57. "city": "青岛" 
    58. } 

  • 通过城市id或名称获得天气数据,XML数据
    http://wthrcdn.etouch.cn/WeatherApi?citykey=101120201
    http://wthrcdn.etouch.cn/WeatherApi?city=青岛

    <?xml version="1.0" encoding="UTF-8"?><resp><city>青岛</city><updatetime>15:25</updatetime><wendu>4</wendu><fengli>3级</fengli><shidu>50%</shidu><fengxiang>东北风</fengxiang><sunrise_1>06:58</sunrise_1><sunset_1>16:44</sunset_1><sunrise_2></sunrise_2><sunset_2></sunset_2><environment><aqi>51</aqi><pm25>20</pm25><suggest>极少数敏感人群应减少户外活动</suggest><quality>良</quality><MajorPollutants>颗粒物(PM10)</MajorPollutants><o3>65</o3><co>0</co><pm10>50</pm10><so2>21</so2><no2>26</no2><time>15:00:00</time></environment><alarm><cityKey>10112</cityKey><cityName><![CDATA[山东省]]></cityName><alarmType><![CDATA[霾]]></alarmType><alarmDegree><![CDATA[黄色]]></alarmDegree><alarmText><![CDATA[山东省气象台发布霾黄色预警]]></alarmText><alarm_details><![CDATA[继续发布霾黄色预警信号:预计今天夜间,鲁西北、鲁中和鲁南的大部地区有中度以上的霾天气。8日16时]]></alarm_details><standard><![CDATA[预计未来24小时内可能出现下列条件之一并将持续或实况已达到下列条件之一并可能持续:能见度小于3000米且相对湿度小于80%的霾;能见度小于3000米且相对湿度大于等于80%,PM2.5浓度大于115微克/立方米且小于等于150微克/立方米:能见度小于5000米,PM2.5浓度大于150微克/立方米且小于等于250微克/立方米。]]></standard><suggest><![CDATA[1、空气质量明显降低,人员需适当防护;2、一般人群适量减少户外活动,儿童、老人及易感人群应减少外出。]]></suggest><imgUrl><![CDATA[http://static.etouch.cn/apps/weather/alarm_icon-1/mai_yellow-1.png]]></imgUrl><time>2016-12-08 16:22:00</time></alarm><yesterday><date_1>8日星期四</date_1><high_1>高温 11℃</high_1><low_1>低温 2℃</low_1><day_1><type_1>多云</type_1><fx_1>南风</fx_1><fl_1>5-6级</fl_1></day_1><night_1><type_1>晴</type_1><fx_1>北风</fx_1><fl_1>5-6级</fl_1></night_1></yesterday><forecast><weather><date>9日星期五</date><high>高温 6℃</high><low>低温 0℃</low><day><type>晴</type><fengxiang>北风</fengxiang><fengli>4-5级</fengli></day><night><type>多云</type><fengxiang>北风</fengxiang><fengli>3-4级</fengli></night></weather><weather><date>10日星期六</date><high>高温 7℃</high><low>低温 2℃</low><day><type>晴</type><fengxiang>北风</fengxiang><fengli>3-4级</fengli></day><night><type>多云</type><fengxiang>南风</fengxiang><fengli>3-4级</fengli></night></weather><weather><date>11日星期天</date><high>高温 9℃</high><low>低温 4℃</low><day><type>晴</type><fengxiang>北风</fengxiang><fengli>3-4级</fengli></day><night><type>多云</type><fengxiang>北风</fengxiang><fengli>3-4级</fengli></night></weather><weather><date>12日星期一</date><high>高温 8℃</high><low>低温 1℃</low><day><type>阵雨</type><fengxiang>南风</fengxiang><fengli>3-4级</fengli></day><night><type>阵雨</type><fengxiang>南风</fengxiang><fengli>4-5级</fengli></night></weather><weather><date>13日星期二</date><high>高温 6℃</high><low>低温 -1℃</low><day><type>晴</type><fengxiang>北风</fengxiang><fengli>5-6级</fengli></day><night><type>晴</type><fengxiang>北风</fengxiang><fengli>5-6级</fengli></night></weather></forecast><zhishus><zhishu><name>晨练指数</name><value>较不宜</value><detail>风力稍大,较不宜晨练,室外锻炼请注意选择避风的地点,避免迎风锻炼。</detail></zhishu><zhishu><name>舒适度</name><value>较不舒适</value><detail>白天天气较凉,且风力较强,您会感觉偏冷,不很舒适,请注意添加衣物,以防感冒。</detail></zhishu><zhishu><name>穿衣指数</name><value>冷</value><detail>天气冷,建议着棉服、羽绒服、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣、冬大衣或厚羽绒服。</detail></zhishu><zhishu><name>感冒指数</name><value>极易发</value><detail>将有一次强降温过程,且风力较强,极易发生感冒,请特别注意增加衣服保暖防寒。</detail></zhishu><zhishu><name>晾晒指数</name><value>基本适宜</value><detail>天气不错,午后温暖的阳光仍能满足你驱潮消霉杀菌的晾晒需求。</detail></zhishu><zhishu><name>旅游指数</name><value>一般</value><detail>天气较好,温度稍低,加之风稍大,让人感觉有点凉,会对外出有一定影响,外出注意防风保暖。</detail></zhishu><zhishu><name>紫外线强度</name><value>弱</value><detail>紫外线强度较弱,建议出门前涂擦SPF在12-15之间、PA+的防晒护肤品。</detail></zhishu><zhishu><name>洗车指数</name><value>较不宜</value><detail>较不宜洗车,未来一天无雨,风力较大,如果执意擦洗汽车,要做好蒙上污垢的心理准备。</detail></zhishu><zhishu><name>运动指数</name><value>较不宜</value><detail>天气较好,但考虑风力较大,天气寒冷,推荐您进行室内运动,若在户外运动须注意保暖。</detail></zhishu><zhishu><name>约会指数</name><value>较不适宜</value><detail>天气较好,但风力较大,建议尽量不要去室外约会,如果外出,请您挑选避风的地点。</detail></zhishu><zhishu><name>雨伞指数</name><value>不带伞</value><detail>天气较好,您在出门的时候无须带雨伞。</detail></zhishu></zhishus></resp><!-- 10.10.162.42(10.10.162.42):42379 ; 10.10.162.42:8080 -->
    

3. 51万年历

  • Type=1
    http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101120201&weatherType=1


    1. "weatherinfo": { 
    2. "Radar": "", 
    3. "SD": "51%", 
    4. "WD": "东北风", 
    5. "WS": "4级", 
    6. "WSE": 6, 
    7. "city": "青岛", 
    8. "cityid": "101120201", 
    9. "isRadar": 1, 
    10. "njd": "", 
    11. "qy": "0", 
    12. "temp": "4", 
    13. "time": "2016-12-09T14:33:57.153" 
    14. } 

  • Type=0
    http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101120201&weatherType=0


    1. "weatherinfo": { 
    2. "city": "青岛", 
    3. "city_en": "", 
    4. "cityid": "101120201", 
    5. "date": "", 
    6. "date_y": "2016年12月09日", 
    7. "img_title_single": "", 
    8. "index": "", 
    9. "index48": "", 
    10. "index48_d ": "", 
    11. "index48_uv": "", 
    12. "index_ag": "", 
    13. "index_cl": "", 
    14. "index_co": "", 
    15. "index_d": "", 
    16. "index_ls": "", 
    17. "index_tr": "", 
    18. "index_uv": "", 
    19. "index_xc": "", 
    20. "fx1": "", 
    21. "fx2": "", 
    22. "fl1": "", 
    23. "img1": "2", 
    24. "img_title1": "阴", 
    25. "st1": 0, 
    26. "temp1": "4℃~6℃", 
    27. "tempF1": "", 
    28. "weather1": "阴", 
    29. "wind1": "东北风", 
    30. "fl2": "", 
    31. "img2": "1", 
    32. "img_title2": "多云", 
    33. "st2": 0, 
    34. "temp2": "3℃~6℃", 
    35. "tempF2": "", 
    36. "weather2": "多云", 
    37. "wind2": "东北风", 
    38. "fl3": "", 
    39. "img3": "0", 
    40. "img_title3": "晴天", 
    41. "st3": 0, 
    42. "temp3": "5℃~9℃", 
    43. "tempF3": "", 
    44. "weather3": "晴天", 
    45. "wind3": "东南风", 
    46. "fl4": "", 
    47. "img4": "2", 
    48. "img_title4": "阴", 
    49. "st4": 0, 
    50. "temp4": "9℃~12℃", 
    51. "tempF4": "", 
    52. "weather4": "阴", 
    53. "wind4": "南风", 
    54. "fl5": "", 
    55. "img5": "29", 
    56. "img_title5": "风", 
    57. "st5": 0, 
    58. "temp5": "1℃~9℃", 
    59. "tempF5": "", 
    60. "weather5": "风", 
    61. "wind5": "北风", 
    62. "fl6": "", 
    63. "img6": "29", 
    64. "img_title6": "风", 
    65. "st6": 0, 
    66. "temp6": "0℃~3℃", 
    67. "tempF6": "", 
    68. "weather6": "风", 
    69. "wind6": "北风", 
    70. "img7": "0", 
    71. "img_title7": "", 
    72. "img8": "0", 
    73. "img_title8": "", 
    74. "img9": "0", 
    75. "img_title9": "", 
    76. "img10": "0", 
    77. "img_title10": "", 
    78. "img11": "0", 
    79. "img_title11": "", 
    80. "img12": "0", 
    81. "img_title12": "" 
    82. } 

4. 金山毒霸

http://weather.123.duba.net/static/weather_info/101120201.html?callback=(callback参数可选)


  1. "weatherinfo": { 
  2. "city_en": "qingdao", 
  3. "city": "青岛", 
  4. "cityid": "101120201", 
  5. "week": "星期五", 
  6. "date_y": "2016年12月09日", 
  7. "fchh": 1, 
  8. "date": "201612091100", 
  9. "dt": 2, 
  10. "fl1": "4-5级", 
  11. "fl2": "3-4级", 
  12. "fl3": "3-4级", 
  13. "fl4": "3-4级", 
  14. "fl5": "5-6级", 
  15. "fl6": "4-5级", 
  16. "fx1": "北风", 
  17. "fx2": "北风", 
  18. "img1": "0", 
  19. "img2": "1", 
  20. "img3": "0", 
  21. "img4": "1", 
  22. "img5": "0", 
  23. "img6": "1", 
  24. "img7": "3", 
  25. "img8": "3", 
  26. "img9": "0", 
  27. "img10": "0", 
  28. "img11": "0", 
  29. "img12": "0", 
  30. "img_single": "0", 
  31. "img_title1": "晴", 
  32. "img_title2": "多云", 
  33. "img_title3": "晴", 
  34. "img_title4": "多云", 
  35. "img_title5": "晴", 
  36. "img_title6": "多云", 
  37. "img_title7": "阵雨", 
  38. "img_title8": "阵雨", 
  39. "img_title9": "晴", 
  40. "img_title10": "晴", 
  41. "img_title11": "晴", 
  42. "img_title12": "晴", 
  43. "img_title_single": "晴", 
  44. "pm": "51", 
  45. "pm-level": "良", 
  46. "pm-num": "2", 
  47. "pm-pubtime": "2016-12-09 14:00:00", 
  48. "pm-url": "", 
  49. "rl1": "16:44", 
  50. "rc1": "06:57", 
  51. "rl2": "16:44", 
  52. "rc2": "06:58", 
  53. "sd": "52%", 
  54. "st1": "0", 
  55. "st2": "0", 
  56. "st3": "0", 
  57. "st4": "3", 
  58. "st5": "0", 
  59. "st6": "0", 
  60. "temp": "4", 
  61. "temp1": "6℃~0℃", 
  62. "tempF1": "42.8℃~32℃", 
  63. "temp2": "7℃~2℃", 
  64. "tempF2": "44.6℃~35.6℃", 
  65. "temp3": "9℃~4℃", 
  66. "tempF3": "48.2℃~39.2℃", 
  67. "temp4": "8℃~1℃", 
  68. "tempF4": "46.4℃~33.8℃", 
  69. "temp5": "6℃~-1℃", 
  70. "tempF5": "42.8℃~30.2℃", 
  71. "temp6": "3℃~-3℃", 
  72. "tempF6": "37.4℃~26.6℃", 
  73. "wd": "北风", 
  74. "weather1": "晴", 
  75. "weather2": "晴", 
  76. "weather3": "晴", 
  77. "weather4": "阵雨", 
  78. "weather5": "晴", 
  79. "weather6": "晴", 
  80. "wind1": "4-5级", 
  81. "wind2": "3-4级", 
  82. "wind3": "3-4级", 
  83. "wind4": "3-4级", 
  84. "wind5": "5-6级", 
  85. "wind6": "4-5级", 
  86. "ws": "2级", 
  87. "wse": "2" 
  88. }
  89. "update_time": "2016-12-09 15:55:08"
  90. "t": 1481270653
  91. "from": "cache" 

5. 小米天气

"碉堡了"
http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101120201


  1. "forecast": { 
  2. "city": "请更换接口", 
  3. "city_en": "Please change api to v3", 
  4. "cityid": "101120201", 
  5. "date": "", 
  6. "date_y": "2016年12月09日", 
  7. "fchh": "07", 
  8. "fl1": "小于3级", 
  9. "fl2": "小于3级", 
  10. "fl3": "小于3级", 
  11. "fl4": "小于3级", 
  12. "fl5": "小于3级", 
  13. "fl6": "微风", 
  14. "fx1": "微风", 
  15. "fx2": "微风", 
  16. "img1": "", 
  17. "img10": "", 
  18. "img11": "", 
  19. "img12": "", 
  20. "img2": "", 
  21. "img3": "", 
  22. "img4": "", 
  23. "img5": "", 
  24. "img6": "", 
  25. "img7": "", 
  26. "img8": "", 
  27. "img9": "", 
  28. "img_single": "", 
  29. "img_title1": "晴", 
  30. "img_title10": "多云", 
  31. "img_title11": "晴", 
  32. "img_title12": "晴", 
  33. "img_title2": "多云", 
  34. "img_title3": "晴", 
  35. "img_title4": "晴", 
  36. "img_title5": "多云", 
  37. "img_title6": "阴", 
  38. "img_title7": "阵雨", 
  39. "img_title8": "阵雨", 
  40. "img_title9": "多云", 
  41. "img_title_single": "", 
  42. "index": "舒适", 
  43. "index48": "", 
  44. "index48_d": "", 
  45. "index48_uv": "", 
  46. "index_ag": "易发", 
  47. "index_cl": "较适宜", 
  48. "index_co": "舒适", 
  49. "index_d": "", 
  50. "index_ls": "适宜", 
  51. "index_tr": "适宜", 
  52. "index_uv": "中等", 
  53. "index_xc": "较适宜", 
  54. "st1": "", 
  55. "st2": "", 
  56. "st3": "", 
  57. "st4": "", 
  58. "st5": "", 
  59. "st6": "", 
  60. "temp1": "6℃~0℃", 
  61. "temp2": "7℃~1℃", 
  62. "temp3": "10℃~7℃", 
  63. "temp4": "12℃~1℃", 
  64. "temp5": "6℃~-1℃", 
  65. "temp6": "0℃~0℃", 
  66. "tempF1": "", 
  67. "tempF2": "", 
  68. "tempF3": "", 
  69. "tempF4": "", 
  70. "tempF5": "", 
  71. "tempF6": "", 
  72. "weather1": "晴转多云", 
  73. "weather2": "晴", 
  74. "weather3": "多云转阴", 
  75. "weather4": "阵雨", 
  76. "weather5": "多云", 
  77. "weather6": "晴", 
  78. "week": "星期二", 
  79. "wind1": "微风", 
  80. "wind2": "微风", 
  81. "wind3": "微风", 
  82. "wind4": "微风", 
  83. "wind5": "微风", 
  84. "wind6": "微风" 
  85. }
  86. "realtime": { 
  87. "SD": "45%", 
  88. "WD": "北风", 
  89. "WS": "3级", 
  90. "WSE": "", 
  91. "city": "", 
  92. "cityid": "101120201", 
  93. "isRadar": "1", 
  94. "radar": "JC_RADAR_AZ9010_JB", 
  95. "temp": "5", 
  96. "time": "15:20", 
  97. "weather": "晴" 
  98. }
  99. "alert": []
  100. "aqi": { 
  101. "city": "青岛", 
  102. "city_id": "101120201", 
  103. "pub_time": "2016-12-09 14:00", 
  104. "aqi": "46", 
  105. "pm25": "21", 
  106. "pm10": "51", 
  107. "so2": "21", 
  108. "no2": "27", 
  109. "src": "中国环境监测总站", 
  110. "spot": "" 
  111. }
  112. "index": [ 
  113. { 
  114. "code": "fs", 
  115. "details": "属弱紫外辐射天气,长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。", 
  116. "index": "弱", 
  117. "name": "防晒指数", 
  118. "otherName": "" 
  119. }, 
  120. { 
  121. "code": "ct", 
  122. "details": "建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。", 
  123. "index": "较舒适", 
  124. "name": "穿衣指数", 
  125. "otherName": "" 
  126. }, 
  127. { 
  128. "code": "yd", 
  129. "details": "天气较好,但风力较大,推荐您进行室内运动,若在户外运动请注意避风保暖。", 
  130. "index": "较适宜", 
  131. "name": "运动指数", 
  132. "otherName": "" 
  133. }, 
  134. { 
  135. "code": "xc", 
  136. "details": "较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。", 
  137. "index": "较适宜", 
  138. "name": "洗车指数", 
  139. "otherName": "" 
  140. }, 
  141. { 
  142. "code": "ls", 
  143. "details": "天气不错,适宜晾晒。赶紧把久未见阳光的衣物搬出来吸收一下太阳的味道吧!", 
  144. "index": "适宜", 
  145. "name": "晾晒指数", 
  146. "otherName": "" 
  147. } 
  148. ]
  149. "accu_cc": { 
  150. "EpochTime": "1481268000", 
  151. "LocalObservationDateTime": "2016-12-09T15:20:00+08:00", 
  152. "Pressure": "1027.0", 
  153. "RealFeelTemperature": "2.8", 
  154. "RelativeHumidity": "45", 
  155. "UVIndex": "1", 
  156. "Visibility": "16.1", 
  157. "WindDirectionDegrees": "0", 
  158. "WindSpeed": "13.0" 
  159. }
  160. "accu_f5": { 
  161. "EffectiveEpochDate": "1481497200", 
  162. "EffectiveDate": "2016-12-12T07:00:00+08:00", 
  163. "DailyForecasts": [ 
  164. { 
  165. "Date": "2016-12-09T07:00:00+08:00", 
  166. "EpochDate": "1481238000", 
  167. "Sun_Rise": "2016-12-09T06:58:00+08:00", 
  168. "Sun_EpochRise": "1481237880", 
  169. "Sun_Set": "2016-12-09T16:44:00+08:00", 
  170. "Sun_EpochSet": "1481273040", 
  171. "PrecipitationProbability": "1" 
  172. }, 
  173. { 
  174. "Date": "2016-12-10T07:00:00+08:00", 
  175. "EpochDate": "1481324400", 
  176. "Sun_Rise": "2016-12-10T06:59:00+08:00", 
  177. "Sun_EpochRise": "1481324340", 
  178. "Sun_Set": "2016-12-10T16:44:00+08:00", 
  179. "Sun_EpochSet": "1481359440", 
  180. "PrecipitationProbability": "1" 
  181. }, 
  182. { 
  183. "Date": "2016-12-11T07:00:00+08:00", 
  184. "EpochDate": "1481410800", 
  185. "Sun_Rise": "2016-12-11T06:59:00+08:00", 
  186. "Sun_EpochRise": "1481410740", 
  187. "Sun_Set": "2016-12-11T16:44:00+08:00", 
  188. "Sun_EpochSet": "1481445840", 
  189. "PrecipitationProbability": "0" 
  190. }, 
  191. { 
  192. "Date": "2016-12-12T07:00:00+08:00", 
  193. "EpochDate": "1481497200", 
  194. "Sun_Rise": "2016-12-12T07:00:00+08:00", 
  195. "Sun_EpochRise": "1481497200", 
  196. "Sun_Set": "2016-12-12T16:45:00+08:00", 
  197. "Sun_EpochSet": "1481532300", 
  198. "PrecipitationProbability": "55" 
  199. }, 
  200. { 
  201. "Date": "2016-12-13T07:00:00+08:00", 
  202. "EpochDate": "1481583600", 
  203. "Sun_Rise": "2016-12-13T07:01:00+08:00", 
  204. "Sun_EpochRise": "1481583660", 
  205. "Sun_Set": "2016-12-13T16:45:00+08:00", 
  206. "Sun_EpochSet": "1481618700", 
  207. "PrecipitationProbability": "14" 
  208. } 
  209. ] 
  210. }
  211. "today": { 
  212. "cityCode": "2580084", 
  213. "date": "2016-12-09", 
  214. "humidityMax": 86, 
  215. "humidityMin": 45, 
  216. "precipitationMax": 0, 
  217. "precipitationMin": 0, 
  218. "tempMax": 5, 
  219. "tempMin": -2, 
  220. "weatherEnd": "晴", 
  221. "weatherStart": "晴", 
  222. "windDirectionEnd": "北风", 
  223. "windDirectionStart": "西北风", 
  224. "windMax": 4, 
  225. "windMin": 1 
  226. }
  227. "yestoday": { 
  228. "cityCode": "2580084", 
  229. "date": "2016-12-08", 
  230. "humidityMax": 93, 
  231. "humidityMin": 60, 
  232. "precipitationMax": 0, 
  233. "precipitationMin": 0, 
  234. "tempMax": 11, 
  235. "tempMin": -1, 
  236. "weatherEnd": "晴", 
  237. "weatherStart": "雾", 
  238. "windDirectionEnd": "西北风", 
  239. "windDirectionStart": "北风", 
  240. "windMax": 4, 
  241. "windMin": 0 
  242. } 

6. 360天气

http://cdn.weather.hao.360.cn/api_weather_info.php?app=hao360&code=101120201
_jsonp= 参数可省略


  1. "time": 1481272775
  2. "area": [ 
  3. [ 
  4. "山东", 
  5. "12" 
  6. ], 
  7. [ 
  8. "青岛", 
  9. "1202" 
  10. ], 
  11. [ 
  12. "青岛", 
  13. "101120201" 
  14. ] 
  15. ]
  16. "weather": [ 
  17. { 
  18. "date": "2016-12-09", 
  19. "info": { 
  20. "day": [ 
  21. "0", 
  22. "晴", 
  23. "6", 
  24. "北风", 
  25. "4-5 级" 
  26. ], 
  27. "night": [ 
  28. "1", 
  29. "多云", 
  30. "0", 
  31. "北风", 
  32. "3-4 级" 
  33. ] 
  34. } 
  35. }, 
  36. { 
  37. "date": "2016-12-10", 
  38. "info": { 
  39. "dawn": [ 
  40. "1", 
  41. "多云", 
  42. "0", 
  43. "北风", 
  44. "3-4 级" 
  45. ], 
  46. "day": [ 
  47. "0", 
  48. "晴", 
  49. "7", 
  50. "北风", 
  51. "3-4 级" 
  52. ], 
  53. "night": [ 
  54. "1", 
  55. "多云", 
  56. "2", 
  57. "南风", 
  58. "3-4 级" 
  59. ] 
  60. } 
  61. }, 
  62. { 
  63. "date": "2016-12-11", 
  64. "info": { 
  65. "dawn": [ 
  66. "1", 
  67. "多云", 
  68. "2", 
  69. "南风", 
  70. "3-4 级" 
  71. ], 
  72. "day": [ 
  73. "0", 
  74. "晴", 
  75. "9", 
  76. "北风", 
  77. "3-4 级" 
  78. ], 
  79. "night": [ 
  80. "1", 
  81. "多云", 
  82. "4", 
  83. "北风", 
  84. "3-4 级" 
  85. ] 
  86. } 
  87. }, 
  88. { 
  89. "date": "2016-12-12", 
  90. "info": { 
  91. "dawn": [ 
  92. "1", 
  93. "多云", 
  94. "4", 
  95. "北风", 
  96. "3-4 级" 
  97. ], 
  98. "day": [ 
  99. "3", 
  100. "阵雨", 
  101. "8", 
  102. "南风", 
  103. "3-4 级" 
  104. ], 
  105. "night": [ 
  106. "3", 
  107. "阵雨", 
  108. "1", 
  109. "南风", 
  110. "4-5 级" 
  111. ] 
  112. } 
  113. }, 
  114. { 
  115. "date": "2016-12-13", 
  116. "info": { 
  117. "dawn": [ 
  118. "3", 
  119. "阵雨", 
  120. "1", 
  121. "南风", 
  122. "4-5 级" 
  123. ], 
  124. "day": [ 
  125. "0", 
  126. "晴", 
  127. "6", 
  128. "北风", 
  129. "5-6 级" 
  130. ], 
  131. "night": [ 
  132. "0", 
  133. "晴", 
  134. "-1", 
  135. "北风", 
  136. "5-6 级" 
  137. ] 
  138. } 
  139. } 
  140. ]
  141. "pm25": { 
  142. "area": [ 
  143. "青岛", 
  144. "101120201" 
  145. ], 
  146. "pm25": [ 
  147. 47, 
  148. "2016120915" 
  149. ] 
  150. } 

其他

心知天气,彩云天气,和风天气,据说有免费版,具体视情况而定,毕竟人家靠这吃饭;

百度API市场、聚合数据API等市场也有一些免费的,不过需要使用申请他们的key。

参考:
1 天气预报数据API
2 气象API(2)
3【Joytag 小项目】智能小终端,天气预报接口
4 国家气象局提供的天气预报接口(完整Json接口)
5 中国天气预报数据API收集
6 WEATHER API 收集整理

天气预报API(三):免费接口测试(“旧编码”)

标签:lan   name   整理   poll   也有   tao   oda   参考   shu   

原文地址:http://www.cnblogs.com/oucbl/p/6155392.html

(0)
(2)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!