google了下,很多以前能用的天气预报API现在都失效了,郁闷。。
现在哪个比较好用
现在用的百度的
http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=您的密钥
{
error: 0,
status: "success",
date: "2016-11-14",
results: [
{
currentCity: "北京",
pm25: "40",
index: [
{
title: "穿衣",
zs: "冷",
tipt: "穿衣指数",
des: "天气冷,建议着棉服、羽绒服、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣、冬大衣或厚羽绒服。"
},
{
title: "洗车",
zs: "较不宜",
tipt: "洗车指数",
des: "较不宜洗车,未来一天无雨,风力较大,如果执意擦洗汽车,要做好蒙上污垢的心理准备。"
},
{
title: "旅游",
zs: "适宜",
tipt: "旅游指数",
des: "天气较好,风稍大,但温度适宜,是个好天气哦。适宜旅游,您可以尽情地享受大自然的无限风光。"
},
{
title: "感冒",
zs: "极易发",
tipt: "感冒指数",
des: "昼夜温差极大,且风力较强,极易发生感冒,请特别注意增减衣服保暖防寒。"
},
{
title: "运动",
zs: "较不宜",
tipt: "运动指数",
des: "天气较好,但考虑风力较大,天气寒冷,推荐您进行室内运动,若在户外运动须注意保暖。"
},
{
title: "紫外线强度",
zs: "中等",
tipt: "紫外线强度指数",
des: "属中等强度紫外线辐射天气,外出时建议涂擦SPF高于15、PA+的防晒护肤品,戴帽子、太阳镜。"
}
],
weather_data: [
{
date: "周一 11月14日 (实时:13℃)",
dayPictureUrl: "http://api.map.baidu.com/images/weather/day/qing.png",
nightPictureUrl: "http://api.map.baidu.com/images/weather/night/qing.png",
weather: "晴",
wind: "北风4-5级",
temperature: "13 ~ -2℃"
},
{
date: "周二",
dayPictureUrl: "http://api.map.baidu.com/images/weather/day/qing.png",
nightPictureUrl: "http://api.map.baidu.com/images/weather/night/mai.png",
weather: "晴转霾",
wind: "微风",
temperature: "10 ~ -1℃"
},
{
date: "周三",
dayPictureUrl: "http://api.map.baidu.com/images/weather/day/mai.png",
nightPictureUrl: "http://api.map.baidu.com/images/weather/night/mai.png",
weather: "霾",
wind: "微风",
temperature: "11 ~ 1℃"
},
{
date: "周四",
dayPictureUrl: "http://api.map.baidu.com/images/weather/day/mai.png",
nightPictureUrl: "http://api.map.baidu.com/images/weather/night/mai.png",
weather: "霾",
wind: "微风",
temperature: "10 ~ 5℃"
}
]
}
]
}
如果不要求免费的话,目前网上天气数据API还挺多的。
聚合数据上的天气预报API。免费的天气预报接口,国天气预报,生活指数、实况、PM2.5等信息。https://www.juhe.cn/docs/api/...
收费的,全国天气预报API:https://www.juhe.cn/docs/api/...