重庆互联网,19年企业互联网解决经验,专业网站开发、移动端开发、微信端开发、小程序开发!
重庆网络推广公司

腾讯小微(121)— 云API接入(44)

作者:重庆互联网小徐 发布时间:2024-10-25 浏览:20254 赞(1950 收藏 评论(0)

获取天气资源

请求地址:https://{BASE_URL}/xwcloudapi/resources?resource_type=xxxx

其中天气资源的请求参数为: ?resource_type=weather_info 具体的请求参数如下

整体参数介绍

支持的所有参数如下(根据不同的问法,参数组合不同):

{
	"query":"北京明天适合运动吗",
	"content":"",
	"client_ip":"0.0.0.0",
	"intention":"天气",
	"wait_time_second":0,
	"from":"xiaowei",
	"date":{
		"type":"datetime_point",
		"text":"明天",
		"date":"2019-12-04",
		"date_start":"2019-12-04",
		"date_end":"2019-12-04",
		"time":"15:00:00",
		"time_start":"15:00:00",
		"time_end":"15:00:00",
	},
	"loc":{ 
		"country":"中国",
		"province":"湖南省",
		"city":"北京市",
		"town":"北京市",
		"loc_ori":"北京"
		"poi":"大福镇",
		"lat":39.916666,
		"lon":116.4
	}
}

得到的结果如下:

{
    "code": 0,
    "extend_buf": "{\"loc\":\"北京\",\"data\":[{\"date\":\"2019-12-02\",\"condition\":\"晴\",\"min_tp\":\"-5\",\"max_tp\":\"4\",\"wind_lv\":\"3-4级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\",\"pm25\":\"26\",\"quality\":\"优\"},{\"date\":\"2019-12-03\",\"condition\":\"晴\",\"tp\":\"7\",\"min_tp\":\"-3\",\"max_tp\":\"8\",\"wind_lv\":\"3级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西风\",\"pm25\":\"29\",\"quality\":\"优\",\"is_asked\":\"1\"},{\"date\":\"2019-12-04\",\"condition\":\"晴\",\"min_tp\":\"-4\",\"max_tp\":\"9\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\",\"pm25\":\"58\",\"quality\":\"良\"},{\"date\":\"2019-12-05\",\"condition\":\"晴\",\"min_tp\":\"-6\",\"max_tp\":\"2\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"东风\",\"pm25\":\"49\",\"quality\":\"优\"},{\"date\":\"2019-12-06\",\"condition\":\"晴\",\"min_tp\":\"-6\",\"max_tp\":\"3\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\",\"pm25\":\"76\",\"quality\":\"良\"},{\"date\":\"2019-12-07\",\"condition\":\"晴\",\"min_tp\":\"-6\",\"max_tp\":\"4\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"东北风\",\"pm25\":\"107\",\"quality\":\"轻度污染\"},{\"date\":\"2019-12-08\",\"condition\":\"晴\",\"min_tp\":\"-6\",\"max_tp\":\"6\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\",\"pm25\":\"165\",\"quality\":\"轻度污染\"},{\"date\":\"2019-12-09\",\"condition\":\"多云\",\"min_tp\":\"-5\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\"},{\"date\":\"2019-12-10\",\"condition\":\"多云\",\"min_tp\":\"-3\",\"max_tp\":\"6\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西北风\"},{\"date\":\"2019-12-11\",\"condition\":\"晴\",\"min_tp\":\"-4\",\"max_tp\":\"3\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西北风\"},{\"date\":\"2019-12-12\",\"condition\":\"晴\",\"min_tp\":\"-3\",\"max_tp\":\"4\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西北风\"},{\"date\":\"2019-12-13\",\"condition\":\"多云\",\"min_tp\":\"-3\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"南风\"},{\"date\":\"2019-12-14\",\"condition\":\"晴\",\"min_tp\":\"-2\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"北风\"},{\"date\":\"2019-12-15\",\"condition\":\"晴\",\"min_tp\":\"-2\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"南风\"},{\"date\":\"2019-12-16\",\"condition\":\"晴\",\"min_tp\":\"-2\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"西南风\"},{\"date\":\"2019-12-17\",\"condition\":\"晴\",\"min_tp\":\"-2\",\"max_tp\":\"5\",\"wind_lv\":\"3级\",\"wind_level\":\"和缓\",\"wind_direct\":\"南风\"}],\"hourly_data\":[{\"humidity\":\"45\",\"condition\":\"晴\",\"tp\":\"-3\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"1\",\"humidity\":\"45\",\"condition\":\"晴\",\"tp\":\"-3\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"2\",\"humidity\":\"46\",\"condition\":\"晴\",\"tp\":\"-4\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"3\",\"humidity\":\"45\",\"condition\":\"晴\",\"tp\":\"-4\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"4\",\"humidity\":\"43\",\"condition\":\"晴\",\"tp\":\"-3\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"5\",\"humidity\":\"42\",\"condition\":\"晴\",\"tp\":\"-3\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"6\",\"humidity\":\"42\",\"condition\":\"晴\",\"tp\":\"-4\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"7\",\"humidity\":\"42\",\"condition\":\"晴\",\"tp\":\"-4\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"8\",\"humidity\":\"42\",\"condition\":\"晴\",\"tp\":\"-3\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"9\",\"humidity\":\"38\",\"condition\":\"晴\",\"tp\":\"-1\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"10\",\"humidity\":\"33\",\"condition\":\"晴\",\"tp\":\"1\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"11\",\"humidity\":\"28\",\"condition\":\"晴\",\"tp\":\"4\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"北风\"},{\"hour\":\"12\",\"humidity\":\"26\",\"condition\":\"晴\",\"tp\":\"7\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"13\",\"humidity\":\"25\",\"condition\":\"晴\",\"tp\":\"8\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"},{\"hour\":\"14\",\"humidity\":\"24\",\"condition\":\"晴\",\"tp\":\"7\",\"wind_lv\":\"1级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西南风\"},{\"hour\":\"15\",\"humidity\":\"29\",\"condition\":\"晴\",\"tp\":\"6\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西风\"},{\"hour\":\"16\",\"humidity\":\"35\",\"condition\":\"晴\",\"tp\":\"4\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西南风\"},{\"hour\":\"17\",\"humidity\":\"40\",\"condition\":\"晴\",\"tp\":\"3\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西南风\"},{\"hour\":\"18\",\"humidity\":\"41\",\"condition\":\"晴\",\"tp\":\"1\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西南风\"},{\"hour\":\"19\",\"humidity\":\"41\",\"condition\":\"晴\",\"tp\":\"1\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西南风\"},{\"hour\":\"20\",\"humidity\":\"42\",\"condition\":\"晴\",\"tp\":\"1\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西风\"},{\"hour\":\"21\",\"humidity\":\"43\",\"condition\":\"晴\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西风\"},{\"hour\":\"22\",\"humidity\":\"44\",\"condition\":\"晴\",\"tp\":\"-1\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西风\"},{\"hour\":\"23\",\"humidity\":\"44\",\"condition\":\"晴\",\"tp\":\"-2\",\"wind_lv\":\"2级\",\"wind_level\":\"轻微\",\"wind_direct\":\"西北风\"}]}",
    "msg": "成功",
    "request_id": "test_Random",
    "tts": "北京今天晴,温度-3度到8度,当前温度7度,空气质量优,天冷了,该加衣服了!"}

其中extend_buf为结构化数据,包含15天天气,当天24小时天气和告警信息。每次查到天气都会返回,因为数据太长了,之后的文档省略它。


重庆互联网项目从2004年开始为各行各业提供互联网发展解决方案,专业从事网站、小程序、微信公众号、APP、电商平台、系统等互联网平台开发,帮助企业实现从传统行业到互联网的完美转型。截止目前,重庆互联网合作的企业遍布全国各地,20年的开发经验和完善的售后服务体系获得合作客户的高度认可!

关注重庆互联网官方公众号,即可获取粉丝专享福利!

重庆互联网公众号二维码.jpg

网友留言评论
我要评论
评论

欢迎广大用户为此页面进行评价,评价成功将获得积分奖励!

  • 赞(0
    踩(0
重庆网站定制建设
  • 重庆网站建设平台
  • 重庆网站优化公司
  • 重庆网络推广公司哪家好
  • 重庆APP制作公司
版权所有 ©2004-2024 重庆市渝中区圣灵科技信息有限公司 渝ICP备16004600号-14 渝公网安备50010802001420号 电子营业执照
重庆公众号制作哪家好
二维码
联系客服 重庆商城网站建设