百度天气预报
来源:互联网 发布:汉邦尚品 知乎 编辑:程序博客网 时间:2024/05/23 21:25
百度提供天气预报查询接口API,可以根据经纬度/城市名查询天气情况,我们可以在微信公众平台开发中调用这一接口。
接口说明
根据经纬度/城市名查询天气的结果
接口示例
http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=5slgyqGDENN7Sy7pw29IUvrZ
百度ak申请地址:http://lbsyun.baidu.com/apiconsole/key
接口参数说明
返回结果
返回xml格式的数据
<?xml version="1.0" encoding="utf-8" ?> <CityWeatherResponse> <status>success</status> <date>2014-05-03</date> <results> <currentCity>北京</currentCity> <weather_data> <date>周六(今天, 实时:22℃)</date> <dayPictureUrl>http://api.map.baidu.com/images/weather/day/leizhenyu.png</dayPictureUrl> <nightPictureUrl>http://api.map.baidu.com/images/weather/night/duoyun.png</nightPictureUrl> <weather>雷阵雨转多云</weather> <wind>北风5-6级</wind> <temperature>24 ~ 11℃</temperature> <date>周日</date> <dayPictureUrl>http://api.map.baidu.com/images/weather/day/duoyun.png</dayPictureUrl> <nightPictureUrl>http://api.map.baidu.com/images/weather/night/qing.png</nightPictureUrl> <weather>多云转晴</weather> <wind>北风4-5级</wind> <temperature>19 ~ 8℃</temperature> <date>周一</date> <dayPictureUrl>http://api.map.baidu.com/images/weather/day/qing.png</dayPictureUrl> <nightPictureUrl>http://api.map.baidu.com/images/weather/night/qing.png</nightPictureUrl> <weather>晴</weather> <wind>微风</wind> <temperature>21 ~ 9℃</temperature> <date>周二</date> <dayPictureUrl>http://api.map.baidu.com/images/weather/day/duoyun.png</dayPictureUrl> <nightPictureUrl>http://api.map.baidu.com/images/weather/night/qing.png</nightPictureUrl> <weather>多云转晴</weather> <wind>微风</wind> <temperature>21 ~ 10℃</temperature> </weather_data> </results></CityWeatherResponse>
返回json格式的数据
{ "error": 0, "status": "success", "date": "2014-05-03", "results": [ { "currentCity": "北京", "weather_data": [ { "date": "周六(今天, 实时:22℃)", "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/leizhenyu.png", "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/duoyun.png", "weather": "雷阵雨转多云", "wind": "北风5-6级", "temperature": "24 ~ 11℃" }, { "date": "周日", "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/duoyun.png", "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/qing.png", "weather": "多云转晴", "wind": "北风4-5级", "temperature": "19 ~ 8℃" }, { "date": "周一", "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/qing.png", "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/qing.png", "weather": "晴", "wind": "微风", "temperature": "21 ~ 9℃" }, { "date": "周二", "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/duoyun.png", "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/qing.png", "weather": "多云转晴", "wind": "微风", "temperature": "21 ~ 10℃" } ] } ]}
0 0
- 百度天气预报
- 百度天气预报接口
- 百度天气预报接口
- 百度天气预报接口
- 百度天气预报获得
- 百度天气预报接口
- 百度天气预报接口
- 百度天气预报接口介绍
- 百度天气预报接口
- 百度天气预报接口
- 百度 天气预报API
- 百度天气预报接口介绍
- 百度天气预报接口介绍
- 百度天气预报接口介绍
- Android天气预报+百度天气接口
- 百度天气预报API的使用
- Android 基于百度的天气预报
- Android天气预报,Json解析,百度天气接口
- java中英文获取首字母
- Autoconf学习笔记
- EasyUi---tree 导航目录
- 黑马程序员--异常
- 常见对话框
- 百度天气预报
- 矩阵加速递推(XDU 斐波那契数列为列)
- linux shell 字符串操作(长度,查找,替换)详解
- 【对学Oracle数据库初学者的开场篇】
- 黑马程序员--网络编程
- js中没有replaceAll
- [2015/05/06] Start from the outset.
- Relative与Absolute组合使用
- java源码分析之LinkedList