商务服务
html百度天气查询api,百度提供天气预报查询接口API
2024-11-19 03:10

接口说明

html百度天气查询api,百度提供天气预报查询接口API

根据经纬度/城市名查询天气的结果

接口示例

接口参数说明

参数类型

参数名称

是否必须

具体描述

String

ak

true

开发者密钥

String

sn

false

若用户所用ak的校验方式为sn校验时该参数必须。(sn生成算法)

String

location

true

输入城市名或经纬度,城市名称如:北京,经纬度格式为lng,lat坐标如: location=116.305145,39.982368;城市天气预报中间"|"分隔,location=116.305145,39.982368| 122.305145,36.982368|….

String

output

false

输出的数据格式,默认为xml格式,当output设置为’json’时,输出的为json格式的数据;

String

coord_type

false

请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。wgs84表示gps获取的坐标。

返回结果

参数名称

含义

说明

currentCity

当前城市

返回城市名

status

返回结果状态信息

date

当前时间

年-月-日

results

天气预报信息

白天可返回近期3天的天气情况(今天、明天、后天)、晚上可返回近期4天的天气情况(今天、明天、后天、大后天)

results.currentCity

当前城市

results.weather_data

weather_data.date

天气预报时间

weather_data.dayPictureUrl

白天的天气预报图片url

weather_data.nightPictureUrl

晚上的天气预报图片url

weather_data.weather

天气状况

所有天气情况(”|”分隔符):晴|多云|阴|阵雨|雷阵雨|雷阵雨伴有冰雹|雨夹雪|小雨|中雨|大雨|暴雨|大暴雨|特大暴雨|阵雪|小雪|中雪|大雪|暴雪|雾|冻雨|沙尘暴|小雨转中雨|中雨转大雨|大雨转暴雨|暴雨转大暴雨|大暴雨转特大暴雨|小雪转中雪|中雪转大雪|大雪转暴雪|浮尘|扬沙|强沙尘暴|霾

weather_data.wind

风力

weather_data.temperature

温度

返回xml格式的数据

success

2013-07-18

北京市

周三(今天, 实时:24℃)

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

微风

23℃~ 15℃

周四

http://api.map.baidu.com/images/weather/day/leizhenyu.png

http://api.map.baidu.com/images/weather/night/zhongyu.png

雷阵雨转中雨

微风

29~22℃

周五

http://api.map.baidu.com/images/weather/day/yin.png

http://api.map.baidu.com/images/weather/night/duoyun.png

阴转多云

微风

31~23℃

周六

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

微风

31~24℃

合肥市

周三

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

东风3-4级

27℃

周四

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

东北风3-4级

35~27℃

周五

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

南风

35~27℃

周六

http://api.map.baidu.com/images/weather/day/duoyun.png

http://api.map.baidu.com/images/weather/night/duoyun.png

多云

东风

34~27℃

阵雨

东北风3-4级

18℃

返回json格式的数据

{

error: 0,

status: "success",

date: "2013-07-17",

results:

[

{

currentCity: "北京市",

weather_data:

[

{

date: "周三(今天, 实时:24℃)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "微风",

temperature: "23℃~ 15℃"

},

{

date: "明天(周四)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/leizhenyu.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/zhongyu.png",

weather: "雷阵雨转中雨",

wind: "微风",

temperature: "29~22℃"

},

{

date: "后天(周五)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/yin.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "阴转多云",

wind: "微风",

temperature: "31~23℃"

},

{

date: "大后天(周六)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "微风",

temperature: "31~24℃"

}

]

},

{

currentCity: "合肥市",

weather_data:

[

{

date: "今天(周三)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "东风3-4级",

temperature: "27℃"

},

{

date: "明天(周四)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "东北风3-4级",

temperature: "35~27℃"

},

{

date: "后天(周五)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "南风",

temperature: "35~27℃"

},

{

date: "大后天(周六)",

dayPictureUrl: "http://api.map.baidu.com/images/weather/day/duoyun.png",

nightPictureUrl: "http://api.map.baidu.com/images/weather/night/duoyun.png",

weather: "多云",

wind: "东风",

temperature: "34~27℃"

}

]

}

]

    以上就是本篇文章【html百度天气查询api,百度提供天气预报查询接口API】的全部内容了,欢迎阅览 ! 文章地址:http://sicmodule.glev.cn/news/10145.html 
     资讯      企业新闻      行情      企业黄页      同类资讯      首页      网站地图      返回首页 歌乐夫资讯移动站 http://sicmodule.glev.cn/mobile/ , 查看更多   
最新新闻
宇树科技能否复刻大疆成功之路,成为科技新星?王兴兴的创业历程
你可能听过很多关于科技大佬的传奇故事,天才少年、名校毕业、硅谷精英……但今天要讲的这位,却是个彻头彻尾的“学渣”,他用自
“来客兄弟”AI获客:解锁实体门店流量密码
在AI技术日新月异的今天,各行各业都在经历着前所未有的变革。对于实体门店而言,行业竞争加剧、经营成本高昂以及消费者购物习惯
如何轻松掌握AI在线问答?试试这些实用工具
现在,人工智能技术已经渗透到我们生活的方方面面,其中自然也包括了AI在线问答。要更好地利用这一技术,我们可以尝试一些实用的
一次性搞懂什么是AIGC!(一篇文章22个基本概念)
全新的时代,AIGC(Artificial Intelligence Generative Content,即人工智能生成内容)正在重新塑造着
3 个在微信使用 DeepSeek 方法,建议收藏!
昨天带大家体验了微信最新的 AI 搜索功能。相信都被 微信 + DeepSeek R1 这组王炸组合惊艳到,可是目前该功能还在灰度测试中。评
京东pop商家入驻流程是什么?如何确保流程正确?
京东pop商家入驻流程是什么?想要入驻京东的商家数量一直都在上升当中,而入驻当中的流程却有很多商家还不是很熟悉,下面就来告
过年不想被催婚?这些 DeepSeek 给出的高情商技巧可能你用得上
过年最头疼的事情是什么? 走亲戚。 好在,亲戚的问题是生硬的,但我们的回答可以是柔软的;亲戚的关心是直白的,但我们的回应也
京东也能订外卖了??
对标美团而言,秒送几乎囊括了美团的所有主要业务。而秒送之外,“首页”的本地生活、京东旅行等板块还覆盖了火车票、机票、景区
《名侦探柯南》里重要的12个人物,你都知道吗?
在《名侦探柯南》中,柯南原本的身份是高中生侦探工藤新一,在一次偶然事件中目睹了黑衣组织的交易过程,结果被组织成员灌下毒药
疯了!自从DeepSeek出来,我就没过一天正常日子
解放周末!用AI写周报又被老板夸了!点击这里,一键生成周报总结,无脑直接抄 → https://ai.sohu.com/pc/textHome?_trans_=0300