官方网站:https://tianqi.qq.com/
城市接口:https://wis.qq.com/city/like
source: pc (请求类型pc/wx)
city: 龙岗 (搜索地名)
请求结果:{"data":{"101280606":"广东, 深圳, 龙岗"},"message":"OK","status":200} 没有结果data为{}
天气接口: https://wis.qq.com/weather/common
接口参数
source: pc //接口类型px或者wx
weather_type: observe|forecast_1h|forecast_24h|index|alarm|limit|tips|air|rise
province: 广东省
city: 深圳市
county: (县区)
callback: 回调函数 不传直接返回json
_:1555052230023 时间(可不传)
weather_type参数(查询类型,多个|分隔):
observe 当前天气
alarm 预警
tips 天气介绍
index 穿衣,舒适度等等...
air 空气质量
rise 日出
callback: 回调函数
假如callback为jkhd, 接口返回值为 "jkhd(json数据)"。js调用可以使用。
html js简单调用代码
天气查询
腾讯接口天气查询
接口返回值 需要解析 看需求
{
"data":{
"alarm":{
},
"forecast_1h":{
"0":{
"degree":"16",
"update_time":"20190412150000",
"weather":"中雨",
"weather_code":"08",
"weather_short":"中雨",
"wind_direction":"北风",
"wind_power":"4"
},
"1":{
"degree":"15",
"update_time":"20190412160000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"南风",
"wind_power":"3"
},
"2":{
"degree":"14",
"update_time":"20190412170000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"3":{
"degree":"14",
"update_time":"20190412180000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东北风",
"wind_power":"3"
},
"4":{
"degree":"13",
"update_time":"20190412190000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"4"
},
"5":{
"degree":"13",
"update_time":"20190412200000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"北风",
"wind_power":"3"
},
"6":{
"degree":"13",
"update_time":"20190412210000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"3"
},
"7":{
"degree":"12",
"update_time":"20190412220000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"3"
},
"8":{
"degree":"12",
"update_time":"20190412230000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"9":{
"degree":"12",
"update_time":"20190413000000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"10":{
"degree":"12",
"update_time":"20190413010000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"11":{
"degree":"12",
"update_time":"20190413020000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"12":{
"degree":"12",
"update_time":"20190413030000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"13":{
"degree":"12",
"update_time":"20190413040000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"14":{
"degree":"12",
"update_time":"20190413050000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"15":{
"degree":"13",
"update_time":"20190413060000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"16":{
"degree":"15",
"update_time":"20190413070000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"17":{
"degree":"16",
"update_time":"20190413080000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"北风",
"wind_power":"3"
},
"18":{
"degree":"17",
"update_time":"20190413090000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"3"
},
"19":{
"degree":"18",
"update_time":"20190413100000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"3"
},
"20":{
"degree":"19",
"update_time":"20190413110000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"北风",
"wind_power":"3"
},
"21":{
"degree":"20",
"update_time":"20190413120000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东南风",
"wind_power":"3"
},
"22":{
"degree":"20",
"update_time":"20190413130000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东南风",
"wind_power":"3"
},
"23":{
"degree":"20",
"update_time":"20190413140000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"24":{
"degree":"20",
"update_time":"20190413150000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"25":{
"degree":"20",
"update_time":"20190413160000",
"weather":"阴",
"weather_code":"02",
"weather_short":"阴",
"wind_direction":"东风",
"wind_power":"3"
},
"26":{
"degree":"20",
"update_time":"20190413170000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"27":{
"degree":"19",
"update_time":"20190413180000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"28":{
"degree":"18",
"update_time":"20190413190000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"29":{
"degree":"17",
"update_time":"20190413200000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"30":{
"degree":"17",
"update_time":"20190413210000",
"weather":"晴",
"weather_code":"00",
"weather_short":"晴",
"wind_direction":"东风",
"wind_power":"3"
},
"31":{
"degree":"17",
"update_time":"20190413220000",
"weather":"晴",
"weather_code":"00",
"weather_short":"晴",
"wind_direction":"东风",
"wind_power":"3"
},
"32":{
"degree":"17",
"update_time":"20190413230000",
"weather":"晴",
"weather_code":"00",
"weather_short":"晴",
"wind_direction":"北风",
"wind_power":"3"
},
"33":{
"degree":"16",
"update_time":"20190414000000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"4"
},
"34":{
"degree":"16",
"update_time":"20190414010000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"东风",
"wind_power":"3"
},
"35":{
"degree":"16",
"update_time":"20190414020000",
"weather":"多云",
"weather_code":"01",
"weather_short":"多云",
"wind_direction":"北风",
"wind_power":"3"
},
"36":{
"degree":"16",
"update_time":"20190414030000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"37":{
"degree":"16",
"update_time":"20190414040000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"38":{
"degree":"16",
"update_time":"20190414050000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"39":{
"degree":"16",
"update_time":"20190414060000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东风",
"wind_power":"3"
},
"40":{
"degree":"16",
"update_time":"20190414070000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东北风",
"wind_power":"3"
},
"41":{
"degree":"16",
"update_time":"20190414080000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"42":{
"degree":"17",
"update_time":"20190414090000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"东南风",
"wind_power":"3"
},
"43":{
"degree":"17",
"update_time":"20190414100000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"南风",
"wind_power":"3"
},
"44":{
"degree":"17",
"update_time":"20190414110000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
},
"45":{
"degree":"18",
"update_time":"20190414120000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"西南风",
"wind_power":"3"
},
"46":{
"degree":"19",
"update_time":"20190414130000",
"weather":"阴",
"weather_code":"02",
"weather_short":"阴",
"wind_direction":"东南风",
"wind_power":"3"
},
"47":{
"degree":"19",
"update_time":"20190414140000",
"weather":"小雨",
"weather_code":"07",
"weather_short":"小雨",
"wind_direction":"北风",
"wind_power":"3"
}
},
"forecast_24h":{
"0":{
"day_weather":"阴",
"day_weather_code":"02",
"day_weather_short":"阴",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"4",
"day_wind_power_code":"1",
"max_degree":"10",
"min_degree":"9",
"night_weather":"阴",
"night_weather_code":"02",
"night_weather_short":"阴",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-11"
},
"1":{
"day_weather":"小到中雨",
"day_weather_code":"21",
"day_weather_short":"中雨",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"18",
"min_degree":"10",
"night_weather":"小到中雨",
"night_weather_code":"21",
"night_weather_short":"中雨",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-12"
},
"2":{
"day_weather":"中雨",
"day_weather_code":"08",
"day_weather_short":"中雨",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"21",
"min_degree":"16",
"night_weather":"中雨",
"night_weather_code":"08",
"night_weather_short":"中雨",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-13"
},
"3":{
"day_weather":"小雨",
"day_weather_code":"07",
"day_weather_short":"小雨",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"20",
"min_degree":"15",
"night_weather":"阴",
"night_weather_code":"02",
"night_weather_short":"阴",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-14"
},
"4":{
"day_weather":"阴",
"day_weather_code":"02",
"day_weather_short":"阴",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"22",
"min_degree":"15",
"night_weather":"中雨",
"night_weather_code":"08",
"night_weather_short":"中雨",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-15"
},
"5":{
"day_weather":"大雨",
"day_weather_code":"09",
"day_weather_short":"大雨",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"18",
"min_degree":"15",
"night_weather":"阴",
"night_weather_code":"02",
"night_weather_short":"阴",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-16"
},
"6":{
"day_weather":"晴",
"day_weather_code":"00",
"day_weather_short":"晴",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"24",
"min_degree":"15",
"night_weather":"晴",
"night_weather_code":"00",
"night_weather_short":"晴",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-17"
},
"7":{
"day_weather":"晴",
"day_weather_code":"00",
"day_weather_short":"晴",
"day_wind_direction":"北风",
"day_wind_direction_code":"8",
"day_wind_power":"3",
"day_wind_power_code":"0",
"max_degree":"31",
"min_degree":"20",
"night_weather":"晴",
"night_weather_code":"00",
"night_weather_short":"晴",
"night_wind_direction":"北风",
"night_wind_direction_code":"8",
"night_wind_power":"3",
"night_wind_power_code":"0",
"time":"2019-04-18"
}
},
"index":{
"airconditioner":{
"detail":"您将感到很舒适,一般不需要开启空调。",
"info":"较少开启",
"name":"空调开启"
},
"allergy":{
"detail":"天气条件易诱发过敏,有较强降水,如需外出最好穿长衣长裤,预防感冒可能引发的过敏,出行注意携带雨具。",
"info":"易发",
"name":"过敏"
},
"carwash":{
"detail":"不宜洗车,未来24小时内有雨,如果在此期间洗车,雨水和路上的泥水可能会再次弄脏您的爱车。",
"info":"不宜",
"name":"洗车"
},
"chill":{
"detail":"温度未达到风寒所需的低温,稍作防寒准备即可。",
"info":"无",
"name":"风寒"
},
"clothes":{
"detail":"建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。",
"info":"较冷",
"name":"穿衣"
},
"cold":{
"detail":"天冷空气湿度大,易发生感冒,请注意适当增加衣服,加强自我防护避免感冒。",
"info":"易发",
"name":"感冒"
},
"comfort":{
"detail":"白天不太热也不太冷,风力不大,相信您在这样的天气条件下,应会感到比较清爽和舒适。",
"info":"舒适",
"name":"舒适度"
},
"diffusion":{
"detail":"气象条件非常有利于空气污染物稀释、扩散和清除,可在室外正常活动。",
"info":"优",
"name":"空气污染扩散条件"
},
"dry":{
"detail":"有雨,路面湿滑,车辆易打滑,请保持车距,减慢车速,小心驾驶。",
"info":"湿滑",
"name":"路况"
},
"drying":{
"detail":"有较强降水,不适宜晾晒。若需要晾晒,请在室内准备出充足的空间。",
"info":"不宜",
"name":"晾晒"
},
"fish":{
"detail":"天气不好,不适合垂钓。",
"info":"不宜",
"name":"钓鱼"
},
"heatstroke":{
"detail":"温度不高,其他各项气象条件适宜,中暑机率极低。",
"info":"无",
"name":"中暑"
},
"makeup":{
"detail":"风力不大,建议用中性保湿型霜类化妆品,无需选用防晒化妆品。",
"info":"保湿",
"name":"化妆"
},
"mood":{
"detail":"有较强降水,会让人心情不佳,注意自我调节。",
"info":"差",
"name":"心情"
},
"morning":{
"detail":"有较强降水,请避免户外晨练,建议在室内做适当锻炼,保持身体健康。",
"info":"不宜",
"name":"晨练"
},
"sports":{
"detail":"有较强降水,建议您选择在室内进行健身休闲运动。",
"info":"较不宜",
"name":"运动"
},
"sunglasses":{
"detail":"白天有降水天气,视线较差,不需要佩戴太阳镜",
"info":"不需要",
"name":"太阳镜"
},
"sunscreen":{
"detail":"属弱紫外辐射天气,长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。",
"info":"弱",
"name":"防晒"
},
"time":"20190412",
"tourism":{
"detail":"温度适宜,有微风同行,但较强降雨的天气将给您的出行带来很多的不便,若坚持旅行建议带上雨具。",
"info":"一般",
"name":"旅游"
},
"traffic":{
"detail":"有较强降水,路面比较湿滑,交通气象条件一般,刹车距离延长,事故易发期,请注意车距。",
"info":"一般",
"name":"交通"
},
"ultraviolet":{
"detail":"属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。",
"info":"最弱",
"name":"紫外线强度"
},
"umbrella":{
"detail":"有较强降水,您在外出的时候一定要带雨伞,以免被雨水淋湿。",
"info":"带伞",
"name":"雨伞"
}
},
"limit":{
"tail_number":"",
"time":""
},
"observe":{
"degree":"14",
"humidity":"90",
"precipitation":"0.0",
"pressure":"971",
"update_time":"201904121450",
"weather":"阴",
"weather_code":"02",
"weather_short":"阴",
"wind_direction":"8",
"wind_power":"2"
},
"rise":{
"0":{
"sunrise":"06:08",
"sunset":"18:49",
"time":"20190412"
},
"1":{
"sunrise":"06:07",
"sunset":"18:49",
"time":"20190413"
},
"2":{
"sunrise":"06:06",
"sunset":"18:50",
"time":"20190414"
},
"3":{
"sunrise":"06:05",
"sunset":"18:50",
"time":"20190415"
},
"4":{
"sunrise":"06:04",
"sunset":"18:51",
"time":"20190416"
},
"5":{
"sunrise":"06:03",
"sunset":"18:51",
"time":"20190417"
},
"6":{
"sunrise":"06:02",
"sunset":"18:52",
"time":"20190418"
},
"7":{
"sunrise":"06:01",
"sunset":"18:52",
"time":"20190419"
},
"8":{
"sunrise":"06:00",
"sunset":"18:53",
"time":"20190420"
},
"9":{
"sunrise":"05:59",
"sunset":"18:53",
"time":"20190421"
},
"10":{
"sunrise":"05:58",
"sunset":"18:54",
"time":"20190422"
},
"11":{
"sunrise":"05:57",
"sunset":"18:54",
"time":"20190423"
},
"12":{
"sunrise":"05:57",
"sunset":"18:55",
"time":"20190424"
},
"13":{
"sunrise":"05:56",
"sunset":"18:55",
"time":"20190425"
},
"14":{
"sunrise":"05:55",
"sunset":"18:56",
"time":"20190426"
}
},
"tips":{
"observe":{
"0":"天暗下来,你就是阳光~",
"1":"现在的温度比较凉爽~"
}
}
},
"message":"OK",
"status":200
}