首页 > 代码库 > 天气预报API(三):免费接口测试(“旧编码”)
天气预报API(三):免费接口测试(“旧编码”)
说明
我以参考文章为引子,自己测试并扩展,努力寻找更多的气象API...
本文所有测试均以青岛为例。
本文所列接口城市代码(cityid)参数都使用的 “旧编码”:全国城市代码列表(旧) 或 全球城市、景点代码
注:另有 “新编码” 的介绍和使用,详见: 全国城市代码列表(新)
1. 国家气象局
-
当天基础天气接口
http://www.weather.com.cn/data/sk/101120201.html
- {
- "weatherinfo": {
- "city": "青岛",
- "cityid": "101120201",//城市代码
- "temp": "5", //当前温度
- "WD": "南风", //风向
- "WS": "3级", //风速
- "SD": "84%", //相对湿度
- "WSE": "3", //风力
- "time": "17:05", //更新时间
- "isRadar": "1", //是否有雷达图(1表示有雷达图)
- "Radar": "JC_RADAR_AZ9532_JB", //雷达图地址(AZ9532为青岛雷达)
- "njd": "暂无实况",
- "qy": "1009",
- "rain": "0"
- }
- }
- {
-
当天基础天气接口
http://www.weather.com.cn/data/cityinfo/101120201.html
- {
- "weatherinfo": {
- "city": "青岛",
- "cityid": "101120201",
- "temp1": "3℃",
- "temp2": "8℃",
- "weather": "晴转多云",
- "img1": "n0.gif",
- "img2": "d1.gif",
- "ptime": "18:00"
- }
- }
图片的使用:
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="xinjiang" 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="taiwan" 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>
- <china dn="nay">
-
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=青岛
- {
- "desc": "OK",
- "status": 1000,
- "data": {
- "wendu": "4",
- "ganmao": "将有一次强降温过程,且风力较强,极易发生感冒,请特别注意增加衣服保暖防寒。",
- "forecast": [
- {
- "fengxiang": "北风",
- "fengli": "4-5级",
- "high": "高温 6℃",
- "type": "晴",
- "low": "低温 0℃",
- "date": "9日星期五"
- },
- {
- "fengxiang": "北风",
- "fengli": "3-4级",
- "high": "高温 7℃",
- "type": "晴",
- "low": "低温 2℃",
- "date": "10日星期六"
- },
- {
- "fengxiang": "北风",
- "fengli": "3-4级",
- "high": "高温 9℃",
- "type": "晴",
- "low": "低温 4℃",
- "date": "11日星期天"
- },
- {
- "fengxiang": "南风",
- "fengli": "3-4级",
- "high": "高温 8℃",
- "type": "阵雨",
- "low": "低温 1℃",
- "date": "12日星期一"
- },
- {
- "fengxiang": "北风",
- "fengli": "5-6级",
- "high": "高温 6℃",
- "type": "晴",
- "low": "低温 -1℃",
- "date": "13日星期二"
- }
- ],
- "yesterday": {
- "fl": "5-6级",
- "fx": "南风",
- "high": "高温 11℃",
- "type": "多云",
- "low": "低温 2℃",
- "date": "8日星期四"
- },
- "aqi": "51",
- "city": "青岛"
- }
- }
- {
-
通过城市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
- {
- "weatherinfo": {
- "Radar": "",
- "SD": "51%",
- "WD": "东北风",
- "WS": "4级",
- "WSE": 6,
- "city": "青岛",
- "cityid": "101120201",
- "isRadar": 1,
- "njd": "",
- "qy": "0",
- "temp": "4",
- "time": "2016-12-09T14:33:57.153"
- }
- }
- {
-
Type=0
http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101120201&weatherType=0
- {
- "weatherinfo": {
- "city": "青岛",
- "city_en": "",
- "cityid": "101120201",
- "date": "",
- "date_y": "2016年12月09日",
- "img_title_single": "",
- "index": "",
- "index48": "",
- "index48_d ": "",
- "index48_uv": "",
- "index_ag": "",
- "index_cl": "",
- "index_co": "",
- "index_d": "",
- "index_ls": "",
- "index_tr": "",
- "index_uv": "",
- "index_xc": "",
- "fx1": "",
- "fx2": "",
- "fl1": "",
- "img1": "2",
- "img_title1": "阴",
- "st1": 0,
- "temp1": "4℃~6℃",
- "tempF1": "",
- "weather1": "阴",
- "wind1": "东北风",
- "fl2": "",
- "img2": "1",
- "img_title2": "多云",
- "st2": 0,
- "temp2": "3℃~6℃",
- "tempF2": "",
- "weather2": "多云",
- "wind2": "东北风",
- "fl3": "",
- "img3": "0",
- "img_title3": "晴天",
- "st3": 0,
- "temp3": "5℃~9℃",
- "tempF3": "",
- "weather3": "晴天",
- "wind3": "东南风",
- "fl4": "",
- "img4": "2",
- "img_title4": "阴",
- "st4": 0,
- "temp4": "9℃~12℃",
- "tempF4": "",
- "weather4": "阴",
- "wind4": "南风",
- "fl5": "",
- "img5": "29",
- "img_title5": "风",
- "st5": 0,
- "temp5": "1℃~9℃",
- "tempF5": "",
- "weather5": "风",
- "wind5": "北风",
- "fl6": "",
- "img6": "29",
- "img_title6": "风",
- "st6": 0,
- "temp6": "0℃~3℃",
- "tempF6": "",
- "weather6": "风",
- "wind6": "北风",
- "img7": "0",
- "img_title7": "",
- "img8": "0",
- "img_title8": "",
- "img9": "0",
- "img_title9": "",
- "img10": "0",
- "img_title10": "",
- "img11": "0",
- "img_title11": "",
- "img12": "0",
- "img_title12": ""
- }
- }
- {
4. 金山毒霸
http://weather.123.duba.net/static/weather_info/101120201.html?callback=
(callback参数可选)
- {
- "weatherinfo": {
- "city_en": "qingdao",
- "city": "青岛",
- "cityid": "101120201",
- "week": "星期五",
- "date_y": "2016年12月09日",
- "fchh": 1,
- "date": "201612091100",
- "dt": 2,
- "fl1": "4-5级",
- "fl2": "3-4级",
- "fl3": "3-4级",
- "fl4": "3-4级",
- "fl5": "5-6级",
- "fl6": "4-5级",
- "fx1": "北风",
- "fx2": "北风",
- "img1": "0",
- "img2": "1",
- "img3": "0",
- "img4": "1",
- "img5": "0",
- "img6": "1",
- "img7": "3",
- "img8": "3",
- "img9": "0",
- "img10": "0",
- "img11": "0",
- "img12": "0",
- "img_single": "0",
- "img_title1": "晴",
- "img_title2": "多云",
- "img_title3": "晴",
- "img_title4": "多云",
- "img_title5": "晴",
- "img_title6": "多云",
- "img_title7": "阵雨",
- "img_title8": "阵雨",
- "img_title9": "晴",
- "img_title10": "晴",
- "img_title11": "晴",
- "img_title12": "晴",
- "img_title_single": "晴",
- "pm": "51",
- "pm-level": "良",
- "pm-num": "2",
- "pm-pubtime": "2016-12-09 14:00:00",
- "pm-url": "",
- "rl1": "16:44",
- "rc1": "06:57",
- "rl2": "16:44",
- "rc2": "06:58",
- "sd": "52%",
- "st1": "0",
- "st2": "0",
- "st3": "0",
- "st4": "3",
- "st5": "0",
- "st6": "0",
- "temp": "4",
- "temp1": "6℃~0℃",
- "tempF1": "42.8℃~32℃",
- "temp2": "7℃~2℃",
- "tempF2": "44.6℃~35.6℃",
- "temp3": "9℃~4℃",
- "tempF3": "48.2℃~39.2℃",
- "temp4": "8℃~1℃",
- "tempF4": "46.4℃~33.8℃",
- "temp5": "6℃~-1℃",
- "tempF5": "42.8℃~30.2℃",
- "temp6": "3℃~-3℃",
- "tempF6": "37.4℃~26.6℃",
- "wd": "北风",
- "weather1": "晴",
- "weather2": "晴",
- "weather3": "晴",
- "weather4": "阵雨",
- "weather5": "晴",
- "weather6": "晴",
- "wind1": "4-5级",
- "wind2": "3-4级",
- "wind3": "3-4级",
- "wind4": "3-4级",
- "wind5": "5-6级",
- "wind6": "4-5级",
- "ws": "2级",
- "wse": "2"
- },
- "update_time": "2016-12-09 15:55:08",
- "t": 1481270653,
- "from": "cache"
- }
5. 小米天气
"碉堡了"
http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101120201
- {
- "forecast": {
- "city": "请更换接口",
- "city_en": "Please change api to v3",
- "cityid": "101120201",
- "date": "",
- "date_y": "2016年12月09日",
- "fchh": "07",
- "fl1": "小于3级",
- "fl2": "小于3级",
- "fl3": "小于3级",
- "fl4": "小于3级",
- "fl5": "小于3级",
- "fl6": "微风",
- "fx1": "微风",
- "fx2": "微风",
- "img1": "",
- "img10": "",
- "img11": "",
- "img12": "",
- "img2": "",
- "img3": "",
- "img4": "",
- "img5": "",
- "img6": "",
- "img7": "",
- "img8": "",
- "img9": "",
- "img_single": "",
- "img_title1": "晴",
- "img_title10": "多云",
- "img_title11": "晴",
- "img_title12": "晴",
- "img_title2": "多云",
- "img_title3": "晴",
- "img_title4": "晴",
- "img_title5": "多云",
- "img_title6": "阴",
- "img_title7": "阵雨",
- "img_title8": "阵雨",
- "img_title9": "多云",
- "img_title_single": "",
- "index": "舒适",
- "index48": "",
- "index48_d": "",
- "index48_uv": "",
- "index_ag": "易发",
- "index_cl": "较适宜",
- "index_co": "舒适",
- "index_d": "",
- "index_ls": "适宜",
- "index_tr": "适宜",
- "index_uv": "中等",
- "index_xc": "较适宜",
- "st1": "",
- "st2": "",
- "st3": "",
- "st4": "",
- "st5": "",
- "st6": "",
- "temp1": "6℃~0℃",
- "temp2": "7℃~1℃",
- "temp3": "10℃~7℃",
- "temp4": "12℃~1℃",
- "temp5": "6℃~-1℃",
- "temp6": "0℃~0℃",
- "tempF1": "",
- "tempF2": "",
- "tempF3": "",
- "tempF4": "",
- "tempF5": "",
- "tempF6": "",
- "weather1": "晴转多云",
- "weather2": "晴",
- "weather3": "多云转阴",
- "weather4": "阵雨",
- "weather5": "多云",
- "weather6": "晴",
- "week": "星期二",
- "wind1": "微风",
- "wind2": "微风",
- "wind3": "微风",
- "wind4": "微风",
- "wind5": "微风",
- "wind6": "微风"
- },
- "realtime": {
- "SD": "45%",
- "WD": "北风",
- "WS": "3级",
- "WSE": "",
- "city": "",
- "cityid": "101120201",
- "isRadar": "1",
- "radar": "JC_RADAR_AZ9010_JB",
- "temp": "5",
- "time": "15:20",
- "weather": "晴"
- },
- "alert": [],
- "aqi": {
- "city": "青岛",
- "city_id": "101120201",
- "pub_time": "2016-12-09 14:00",
- "aqi": "46",
- "pm25": "21",
- "pm10": "51",
- "so2": "21",
- "no2": "27",
- "src": "中国环境监测总站",
- "spot": ""
- },
- "index": [
- {
- "code": "fs",
- "details": "属弱紫外辐射天气,长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。",
- "index": "弱",
- "name": "防晒指数",
- "otherName": ""
- },
- {
- "code": "ct",
- "details": "建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。",
- "index": "较舒适",
- "name": "穿衣指数",
- "otherName": ""
- },
- {
- "code": "yd",
- "details": "天气较好,但风力较大,推荐您进行室内运动,若在户外运动请注意避风保暖。",
- "index": "较适宜",
- "name": "运动指数",
- "otherName": ""
- },
- {
- "code": "xc",
- "details": "较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。",
- "index": "较适宜",
- "name": "洗车指数",
- "otherName": ""
- },
- {
- "code": "ls",
- "details": "天气不错,适宜晾晒。赶紧把久未见阳光的衣物搬出来吸收一下太阳的味道吧!",
- "index": "适宜",
- "name": "晾晒指数",
- "otherName": ""
- }
- ],
- "accu_cc": {
- "EpochTime": "1481268000",
- "LocalObservationDateTime": "2016-12-09T15:20:00+08:00",
- "Pressure": "1027.0",
- "RealFeelTemperature": "2.8",
- "RelativeHumidity": "45",
- "UVIndex": "1",
- "Visibility": "16.1",
- "WindDirectionDegrees": "0",
- "WindSpeed": "13.0"
- },
- "accu_f5": {
- "EffectiveEpochDate": "1481497200",
- "EffectiveDate": "2016-12-12T07:00:00+08:00",
- "DailyForecasts": [
- {
- "Date": "2016-12-09T07:00:00+08:00",
- "EpochDate": "1481238000",
- "Sun_Rise": "2016-12-09T06:58:00+08:00",
- "Sun_EpochRise": "1481237880",
- "Sun_Set": "2016-12-09T16:44:00+08:00",
- "Sun_EpochSet": "1481273040",
- "PrecipitationProbability": "1"
- },
- {
- "Date": "2016-12-10T07:00:00+08:00",
- "EpochDate": "1481324400",
- "Sun_Rise": "2016-12-10T06:59:00+08:00",
- "Sun_EpochRise": "1481324340",
- "Sun_Set": "2016-12-10T16:44:00+08:00",
- "Sun_EpochSet": "1481359440",
- "PrecipitationProbability": "1"
- },
- {
- "Date": "2016-12-11T07:00:00+08:00",
- "EpochDate": "1481410800",
- "Sun_Rise": "2016-12-11T06:59:00+08:00",
- "Sun_EpochRise": "1481410740",
- "Sun_Set": "2016-12-11T16:44:00+08:00",
- "Sun_EpochSet": "1481445840",
- "PrecipitationProbability": "0"
- },
- {
- "Date": "2016-12-12T07:00:00+08:00",
- "EpochDate": "1481497200",
- "Sun_Rise": "2016-12-12T07:00:00+08:00",
- "Sun_EpochRise": "1481497200",
- "Sun_Set": "2016-12-12T16:45:00+08:00",
- "Sun_EpochSet": "1481532300",
- "PrecipitationProbability": "55"
- },
- {
- "Date": "2016-12-13T07:00:00+08:00",
- "EpochDate": "1481583600",
- "Sun_Rise": "2016-12-13T07:01:00+08:00",
- "Sun_EpochRise": "1481583660",
- "Sun_Set": "2016-12-13T16:45:00+08:00",
- "Sun_EpochSet": "1481618700",
- "PrecipitationProbability": "14"
- }
- ]
- },
- "today": {
- "cityCode": "2580084",
- "date": "2016-12-09",
- "humidityMax": 86,
- "humidityMin": 45,
- "precipitationMax": 0,
- "precipitationMin": 0,
- "tempMax": 5,
- "tempMin": -2,
- "weatherEnd": "晴",
- "weatherStart": "晴",
- "windDirectionEnd": "北风",
- "windDirectionStart": "西北风",
- "windMax": 4,
- "windMin": 1
- },
- "yestoday": {
- "cityCode": "2580084",
- "date": "2016-12-08",
- "humidityMax": 93,
- "humidityMin": 60,
- "precipitationMax": 0,
- "precipitationMin": 0,
- "tempMax": 11,
- "tempMin": -1,
- "weatherEnd": "晴",
- "weatherStart": "雾",
- "windDirectionEnd": "西北风",
- "windDirectionStart": "北风",
- "windMax": 4,
- "windMin": 0
- }
- }
6. 360天气
http://cdn.weather.hao.360.cn/api_weather_info.php?app=hao360&code=101120201
_jsonp= 参数可省略
- {
- "time": 1481272775,
- "area": [
- [
- "山东",
- "12"
- ],
- [
- "青岛",
- "1202"
- ],
- [
- "青岛",
- "101120201"
- ]
- ],
- "weather": [
- {
- "date": "2016-12-09",
- "info": {
- "day": [
- "0",
- "晴",
- "6",
- "北风",
- "4-5 级"
- ],
- "night": [
- "1",
- "多云",
- "0",
- "北风",
- "3-4 级"
- ]
- }
- },
- {
- "date": "2016-12-10",
- "info": {
- "dawn": [
- "1",
- "多云",
- "0",
- "北风",
- "3-4 级"
- ],
- "day": [
- "0",
- "晴",
- "7",
- "北风",
- "3-4 级"
- ],
- "night": [
- "1",
- "多云",
- "2",
- "南风",
- "3-4 级"
- ]
- }
- },
- {
- "date": "2016-12-11",
- "info": {
- "dawn": [
- "1",
- "多云",
- "2",
- "南风",
- "3-4 级"
- ],
- "day": [
- "0",
- "晴",
- "9",
- "北风",
- "3-4 级"
- ],
- "night": [
- "1",
- "多云",
- "4",
- "北风",
- "3-4 级"
- ]
- }
- },
- {
- "date": "2016-12-12",
- "info": {
- "dawn": [
- "1",
- "多云",
- "4",
- "北风",
- "3-4 级"
- ],
- "day": [
- "3",
- "阵雨",
- "8",
- "南风",
- "3-4 级"
- ],
- "night": [
- "3",
- "阵雨",
- "1",
- "南风",
- "4-5 级"
- ]
- }
- },
- {
- "date": "2016-12-13",
- "info": {
- "dawn": [
- "3",
- "阵雨",
- "1",
- "南风",
- "4-5 级"
- ],
- "day": [
- "0",
- "晴",
- "6",
- "北风",
- "5-6 级"
- ],
- "night": [
- "0",
- "晴",
- "-1",
- "北风",
- "5-6 级"
- ]
- }
- }
- ],
- "pm25": {
- "area": [
- "青岛",
- "101120201"
- ],
- "pm25": [
- 47,
- "2016120915"
- ]
- }
- }
其他
心知天气,彩云天气,和风天气,据说有免费版,具体视情况而定,毕竟人家靠这吃饭;
百度API市场、聚合数据API等市场也有一些免费的,不过需要使用申请他们的key。
参考:
1 天气预报数据API
2 气象API(2)
3【Joytag 小项目】智能小终端,天气预报接口
4 国家气象局提供的天气预报接口(完整Json接口)
5 中国天气预报数据API收集
6 WEATHER API 收集整理
天气预报API(三):免费接口测试(“旧编码”)