更多内容,请查看博客原文:高德开放平台天气查询API
https://finolo.gy/2020/01/高德开放平台天气查询API/
高德开放平台下的天气查询接口文档
https://lbs.amap.com/api/webservice/guide/api/weatherinfo
注册开发者账号,获取Key
https://restapi.amap.com/v3/weather/weatherInfo?parameters
parameters代表的参数包括必填参数和可选参数。
https://restapi.amap.com/v3/weather/weatherInfo?key=[key]&city=310115
返回结果:
{
"status": "1",
"count": "1",
"info": "OK",
"infocode": "10000",
"lives": [
{
"province": "上海",
"city": "浦东新区",
"adcode": "310115",
"weather": "多云",
"temperature": "6",
"winddirection": "北",
"windpower": "≤3",
"humidity": "56",
"reporttime": "2020-01-12 17:57:21"
}
]
}
百度api是jsonp的方式获取数据,而高德地图的api是允许跨域的。
更多内容,请查看博客原文:高德开放平台天气查询API
https://finolo.gy/2020/01/高德开放平台天气查询API/
来源:CSDN
作者:footrip
链接:https://blog.csdn.net/footrip/article/details/104711737