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

时间:2023-03-09 00:40:24
天气预报API(三):免费接口测试(“旧编码”)

说明

我以参考文章为引子,自己测试并扩展,努力寻找更多的气象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" 





  • 当天基础天气接口

    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" 





    图片为天气状态的 ico:http://m.weather.com.cn/img/d0.gif

  • 省会城市基础天气接口,返回xml格式

    http://flash.weather.com.cn/wmaps/xml/china.xml

    <china dn="nay">
    <city quName="黑龙江" pyName="heilongjiang" cityname="哈尔滨" state1="14" state2="1" stateDetailed="小雪转多云" tem1="-21" tem2="-11" windState="微风转西北风小于3级"/>
    <city quName="吉林" pyName="jilin" cityname="长春" state1="1" state2="0" stateDetailed="多云转晴" tem1="-14" tem2="-7" windState="微风"/>
    <city quName="辽宁" pyName="liaoning" cityname="沈阳" state1="1" state2="0" stateDetailed="多云转晴" tem1="-13" tem2="-4" windState="北风4-5级转微风"/>
    <city quName="海南" pyName="hainan" cityname="海口" state1="1" state2="1" stateDetailed="多云" tem1="16" tem2="24" windState="东北风3-4级"/>
    <city quName="内蒙古" pyName="neimenggu" cityname="呼和浩特" state1="0" state2="1" stateDetailed="晴转多云" tem1="-12" tem2="0" windState="微风"/>
    <city quName="*" pyName="*" cityname="乌鲁木齐" state1="1" state2="1" stateDetailed="多云" tem1="-4" tem2="4" windState="微风"/>
    <city quName="*" pyName="xizang" cityname="拉萨" state1="0" state2="0" stateDetailed="晴" tem1="-3" tem2="12" windState="微风"/>
    <city quName="青海" pyName="qinghai" cityname="西宁" state1="0" state2="1" stateDetailed="晴转多云" tem1="-9" tem2="12" windState="东南风小于3级"/>
    <city quName="宁夏" pyName="ningxia" cityname="银川" state1="1" state2="1" stateDetailed="多云" tem1="-5" tem2="5" windState="微风"/>
    <city quName="甘肃" pyName="gansu" cityname="兰州" state1="0" state2="1" stateDetailed="晴转多云" tem1="-3" tem2="8" windState="微风"/>
    <city quName="河北" pyName="hebei" cityname="石家庄" state1="0" state2="1" stateDetailed="晴转多云" tem1="-2" tem2="6" windState="微风"/>
    <city quName="河南" pyName="henan" cityname="郑州" state1="0" state2="1" stateDetailed="晴转多云" tem1="2" tem2="10" windState="微风"/>
    <city quName="湖北" pyName="hubei" cityname="武汉" state1="0" state2="0" stateDetailed="晴" tem1="3" tem2="16" windState="微风"/>
    <city quName="湖南" pyName="hunan" cityname="长沙" state1="0" state2="0" stateDetailed="晴" tem1="7" tem2="20" windState="微风"/>
    <city quName="山东" pyName="shandong" cityname="济南" state1="0" state2="1" stateDetailed="晴转多云" tem1="-1" tem2="7" windState="北风3-4级转微风"/>
    <city quName="江苏" pyName="jiangsu" cityname="南京" state1="0" state2="1" stateDetailed="晴转多云" tem1="5" tem2="13" windState="北风转东北风3-4级"/>
    <city quName="安徽" pyName="anhui" cityname="合肥" state1="0" state2="1" stateDetailed="晴转多云" tem1="6" tem2="14" windState="东北风3-4级"/>
    <city quName="山西" pyName="shanxi" cityname="太原" state1="0" state2="1" stateDetailed="晴转多云" tem1="-6" tem2="8" windState="西北风3-4级转微风"/>
    <city quName="陕西" pyName="sanxi" cityname="西安" state1="53" state2="53" stateDetailed="霾" tem1="1" tem2="10" windState="东北风小于3级"/>
    <city quName="四川" pyName="sichuan" cityname="成都" state1="1" state2="2" stateDetailed="多云转阴" tem1="6" tem2="14" windState="南风小于3级"/>
    <city quName="云南" pyName="yunnan" cityname="昆明" state1="0" state2="0" stateDetailed="晴" tem1="3" tem2="19" windState="微风"/>
    <city quName="贵州" pyName="guizhou" cityname="贵阳" state1="0" state2="0" stateDetailed="晴" tem1="6" tem2="18" windState="南风小于3级"/>
    <city quName="浙江" pyName="zhejiang" cityname="杭州" state1="0" state2="0" stateDetailed="晴" tem1="7" tem2="15" windState="东北风小于3级"/>
    <city quName="福建" pyName="fujian" cityname="福州" state1="0" state2="0" stateDetailed="晴" tem1="10" tem2="20" windState="微风转东北风小于3级"/>
    <city quName="江西" pyName="jiangxi" cityname="南昌" state1="18" state2="0" stateDetailed="雾转晴" tem1="6" tem2="17" windState="微风"/>
    <city quName="广东" pyName="guangdong" cityname="广州" state1="0" state2="0" stateDetailed="晴" tem1="12" tem2="24" windState="微风"/>
    <city quName="广西" pyName="guangxi" cityname="南宁" state1="0" state2="0" stateDetailed="晴" tem1="14" tem2="26" windState="东北风小于3级"/>
    <city quName="北京" pyName="beijing" cityname="北京" state1="0" state2="0" stateDetailed="晴" tem1="-2" tem2="4" windState="北风3-4级转南风小于3级"/>
    <city quName="天津" pyName="tianjin" cityname="天津" state1="0" state2="0" stateDetailed="晴" tem1="-2" tem2="6" windState="西北风4-5级转北风小于3级"/>
    <city quName="上海" pyName="shanghai" cityname="上海" state1="0" state2="1" stateDetailed="晴转多云" tem1="8" tem2="14" windState="南风小于3级转微风"/>
    <city quName="重庆" pyName="chongqing" cityname="重庆" state1="1" state2="1" stateDetailed="多云" tem1="9" tem2="17" windState="微风"/>
    <city quName="香港" pyName="xianggang" cityname="香港" state1="1" state2="1" stateDetailed="多云" tem1="17" tem2="22" windState="微风"/>
    <city quName="澳门" pyName="aomen" cityname="澳门" state1="0" state2="0" stateDetailed="晴" tem1="16" tem2="23" windState="微风"/>
    <city quName="*" pyName="*" cityname="台北" state1="7" state2="7" stateDetailed="小雨" tem1="18" tem2="22" windState="微风"/>
    <city quName="西沙" pyName="xisha" cityname="西沙" state1="3" state2="3" stateDetailed="阵雨" tem1="24" tem2="28" windState="东北风4-5级"/>
    <city quName="南沙" pyName="nanshadao" cityname="南沙" state1="3" state2="3" stateDetailed="阵雨" tem1="27" tem2="30" windState="东北风4-5级"/>
    <city quName="钓鱼岛" pyName="diaoyudao" cityname="钓鱼岛" state1="2" state2="7" stateDetailed="阴转小雨" tem1="19" tem2="21" windState="东北风4-5级"/>
    </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. "fengxiang": "北风", 

    8. "fengli": "4-5级", 

    9. "high": "高温 6℃", 

    10. "type": "晴", 

    11. "low": "低温 0℃", 

    12. "date": "9日星期五" 

    13. }, 



    14. "fengxiang": "北风", 

    15. "fengli": "3-4级", 

    16. "high": "高温 7℃", 

    17. "type": "晴", 

    18. "low": "低温 2℃", 

    19. "date": "10日星期六" 

    20. }, 



    21. "fengxiang": "北风", 

    22. "fengli": "3-4级", 

    23. "high": "高温 9℃", 

    24. "type": "晴", 

    25. "low": "低温 4℃", 

    26. "date": "11日星期天" 

    27. }, 



    28. "fengxiang": "南风", 

    29. "fengli": "3-4级", 

    30. "high": "高温 8℃", 

    31. "type": "阵雨", 

    32. "low": "低温 1℃", 

    33. "date": "12日星期一" 

    34. }, 



    35. "fengxiang": "北风", 

    36. "fengli": "5-6级", 

    37. "high": "高温 6℃", 

    38. "type": "晴", 

    39. "low": "低温 -1℃", 

    40. "date": "13日星期二" 



    41. ], 

    42. "yesterday": { 

    43. "fl": "5-6级", 

    44. "fx": "南风", 

    45. "high": "高温 11℃", 

    46. "type": "多云", 

    47. "low": "低温 2℃", 

    48. "date": "8日星期四" 

    49. }, 

    50. "aqi": "51", 

    51. "city": "青岛" 





  • 通过城市id或名称获得天气数据,XML数据

    http://wthrcdn.etouch.cn/WeatherApi?citykey=101120201

    http://wthrcdn.etouch.cn/WeatherApi?city=青岛

    <?xml versxmion="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" 





  • 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": "" 





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. "code": "fs", 

  114. "details": "属弱紫外辐射天气,长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。", 

  115. "index": "弱", 

  116. "name": "防晒指数", 

  117. "otherName": "" 

  118. }, 



  119. "code": "ct", 

  120. "details": "建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。", 

  121. "index": "较舒适", 

  122. "name": "穿衣指数", 

  123. "otherName": "" 

  124. }, 



  125. "code": "yd", 

  126. "details": "天气较好,但风力较大,推荐您进行室内运动,若在户外运动请注意避风保暖。", 

  127. "index": "较适宜", 

  128. "name": "运动指数", 

  129. "otherName": "" 

  130. }, 



  131. "code": "xc", 

  132. "details": "较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。", 

  133. "index": "较适宜", 

  134. "name": "洗车指数", 

  135. "otherName": "" 

  136. }, 



  137. "code": "ls", 

  138. "details": "天气不错,适宜晾晒。赶紧把久未见阳光的衣物搬出来吸收一下太阳的味道吧!", 

  139. "index": "适宜", 

  140. "name": "晾晒指数", 

  141. "otherName": "" 



  142. ], 

  143. "accu_cc": { 

  144. "EpochTime": "1481268000", 

  145. "LocalObservationDateTime": "2016-12-09T15:20:00+08:00", 

  146. "Pressure": "1027.0", 

  147. "RealFeelTemperature": "2.8", 

  148. "RelativeHumidity": "45", 

  149. "UVIndex": "1", 

  150. "Visibility": "16.1", 

  151. "WindDirectionDegrees": "0", 

  152. "WindSpeed": "13.0" 

  153. }, 

  154. "accu_f5": { 

  155. "EffectiveEpochDate": "1481497200", 

  156. "EffectiveDate": "2016-12-12T07:00:00+08:00", 

  157. "DailyForecasts": [ 



  158. "Date": "2016-12-09T07:00:00+08:00", 

  159. "EpochDate": "1481238000", 

  160. "Sun_Rise": "2016-12-09T06:58:00+08:00", 

  161. "Sun_EpochRise": "1481237880", 

  162. "Sun_Set": "2016-12-09T16:44:00+08:00", 

  163. "Sun_EpochSet": "1481273040", 

  164. "PrecipitationProbability": "1" 

  165. }, 



  166. "Date": "2016-12-10T07:00:00+08:00", 

  167. "EpochDate": "1481324400", 

  168. "Sun_Rise": "2016-12-10T06:59:00+08:00", 

  169. "Sun_EpochRise": "1481324340", 

  170. "Sun_Set": "2016-12-10T16:44:00+08:00", 

  171. "Sun_EpochSet": "1481359440", 

  172. "PrecipitationProbability": "1" 

  173. }, 



  174. "Date": "2016-12-11T07:00:00+08:00", 

  175. "EpochDate": "1481410800", 

  176. "Sun_Rise": "2016-12-11T06:59:00+08:00", 

  177. "Sun_EpochRise": "1481410740", 

  178. "Sun_Set": "2016-12-11T16:44:00+08:00", 

  179. "Sun_EpochSet": "1481445840", 

  180. "PrecipitationProbability": "0" 

  181. }, 



  182. "Date": "2016-12-12T07:00:00+08:00", 

  183. "EpochDate": "1481497200", 

  184. "Sun_Rise": "2016-12-12T07:00:00+08:00", 

  185. "Sun_EpochRise": "1481497200", 

  186. "Sun_Set": "2016-12-12T16:45:00+08:00", 

  187. "Sun_EpochSet": "1481532300", 

  188. "PrecipitationProbability": "55" 

  189. }, 



  190. "Date": "2016-12-13T07:00:00+08:00", 

  191. "EpochDate": "1481583600", 

  192. "Sun_Rise": "2016-12-13T07:01:00+08:00", 

  193. "Sun_EpochRise": "1481583660", 

  194. "Sun_Set": "2016-12-13T16:45:00+08:00", 

  195. "Sun_EpochSet": "1481618700", 

  196. "PrecipitationProbability": "14" 





  197. }, 

  198. "today": { 

  199. "cityCode": "2580084", 

  200. "date": "2016-12-09", 

  201. "humidityMax": 86, 

  202. "humidityMin": 45, 

  203. "precipitationMax": 0, 

  204. "precipitationMin": 0, 

  205. "tempMax": 5, 

  206. "tempMin": -2, 

  207. "weatherEnd": "晴", 

  208. "weatherStart": "晴", 

  209. "windDirectionEnd": "北风", 

  210. "windDirectionStart": "西北风", 

  211. "windMax": 4, 

  212. "windMin": 1 

  213. }, 

  214. "yestoday": { 

  215. "cityCode": "2580084", 

  216. "date": "2016-12-08", 

  217. "humidityMax": 93, 

  218. "humidityMin": 60, 

  219. "precipitationMax": 0, 

  220. "precipitationMin": 0, 

  221. "tempMax": 11, 

  222. "tempMin": -1, 

  223. "weatherEnd": "晴", 

  224. "weatherStart": "雾", 

  225. "windDirectionEnd": "西北风", 

  226. "windDirectionStart": "北风", 

  227. "windMax": 4, 

  228. "windMin": 0 





6. 360天气

http://cdn.weather.hao.360.cn/api_weather_info.php?app=hao360&code=101120201

_jsonp= 参数可省略



  1. "time": 1481272775, 

  2. "area": [ 



  3. "山东", 

  4. "12" 

  5. ], 



  6. "青岛", 

  7. "1202" 

  8. ], 



  9. "青岛", 

  10. "101120201" 



  11. ], 

  12. "weather": [ 



  13. "date": "2016-12-09", 

  14. "info": { 

  15. "day": [ 

  16. "0", 

  17. "晴", 

  18. "6", 

  19. "北风", 

  20. "4-5 级" 

  21. ], 

  22. "night": [ 

  23. "1", 

  24. "多云", 

  25. "0", 

  26. "北风", 

  27. "3-4 级" 





  28. }, 



  29. "date": "2016-12-10", 

  30. "info": { 

  31. "dawn": [ 

  32. "1", 

  33. "多云", 

  34. "0", 

  35. "北风", 

  36. "3-4 级" 

  37. ], 

  38. "day": [ 

  39. "0", 

  40. "晴", 

  41. "7", 

  42. "北风", 

  43. "3-4 级" 

  44. ], 

  45. "night": [ 

  46. "1", 

  47. "多云", 

  48. "2", 

  49. "南风", 

  50. "3-4 级" 





  51. }, 



  52. "date": "2016-12-11", 

  53. "info": { 

  54. "dawn": [ 

  55. "1", 

  56. "多云", 

  57. "2", 

  58. "南风", 

  59. "3-4 级" 

  60. ], 

  61. "day": [ 

  62. "0", 

  63. "晴", 

  64. "9", 

  65. "北风", 

  66. "3-4 级" 

  67. ], 

  68. "night": [ 

  69. "1", 

  70. "多云", 

  71. "4", 

  72. "北风", 

  73. "3-4 级" 





  74. }, 



  75. "date": "2016-12-12", 

  76. "info": { 

  77. "dawn": [ 

  78. "1", 

  79. "多云", 

  80. "4", 

  81. "北风", 

  82. "3-4 级" 

  83. ], 

  84. "day": [ 

  85. "3", 

  86. "阵雨", 

  87. "8", 

  88. "南风", 

  89. "3-4 级" 

  90. ], 

  91. "night": [ 

  92. "3", 

  93. "阵雨", 

  94. "1", 

  95. "南风", 

  96. "4-5 级" 





  97. }, 



  98. "date": "2016-12-13", 

  99. "info": { 

  100. "dawn": [ 

  101. "3", 

  102. "阵雨", 

  103. "1", 

  104. "南风", 

  105. "4-5 级" 

  106. ], 

  107. "day": [ 

  108. "0", 

  109. "晴", 

  110. "6", 

  111. "北风", 

  112. "5-6 级" 

  113. ], 

  114. "night": [ 

  115. "0", 

  116. "晴", 

  117. "-1", 

  118. "北风", 

  119. "5-6 级" 







  120. ], 

  121. "pm25": { 

  122. "area": [ 

  123. "青岛", 

  124. "101120201" 

  125. ], 

  126. "pm25": [ 

  127. 47, 

  128. "2016120915" 







其他

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

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

参考:

1 天气预报数据API

2 气象API(2)

3【Joytag 小项目】智能小终端,天气预报接口

4 国家气象局提供的天气预报接口(完整Json接口)

5 中国天气预报数据API收集

6 WEATHER API 收集整理