中国天气预报API接口免费,实时天气和未来15天30天天气状况实时掌握

发现一个可以免费查询天气情况的api:温度、湿度、AQI、天气、风向等。

1、先查询所有城市cityid:
接口URL:(GET)http://send.wxbus163.cn/weather/getCityList
结果:

{
	"code": 200,
	"msg": "ok",
	"list": [
		{
			"id": 2001,
			"cityname": "北京"
		},
		{
			"id": 2002,
			"cityname": "海淀"
		},
		{
			"id": 2003,
			"cityname": "朝阳"
		},
		{
			"id": 2004,
			"cityname": "顺义"
		},
		{
			"id": 2005,
			"cityname": "怀柔"
		},
		.
		.
		.
		.
	]
}

2、查询当天天气:

接口URL:
(POST) http://send.wxbus163.cn/weather/getToday

Body 请求参数
参数名	参数值	是否必填	参数类型	描述说明
cityid   4840   是   String   城市id

{
	"status": 200,
	"msg": "ok",
	"list": {
		"cityname": "北京",
		"today": "06月27日(星期四)",
		"max_temp": "35℃",
		"min_temp": "24℃",
		"now_temp": "32.6℃",
		"weather": "多云",
		"weathercode": "https://i.i8tq.com/e_index/todayweather/01_d.png",
		"aqi": "56",
		"wind": "西南风3级",
		"humidity": "30%",
		"air": "1002",
		"visibility": "24km",
		"shzhishu": [
			{
				"title": "穿衣",
				"des": "短袖"
			},
			{
				"title": "跑步",
				"des": "较适宜"
			},
			{
				"title": "钓鱼",
				"des": "较适宜"
			},
			{
				"title": "洗车",
				"des": "适宜"
			},
			{
				"title": "晾晒",
				"des": "适宜"
			},
			{
				"title": "污染",
				"des": "中"
			}
		]
	}
}

3、查询未来15天天气状况:
接口URL:
(POST )http://send.wxbus163.cn/weather/get15Weather

Body 请求参数
参数名	 参数值	是否必填	 参数类型	  描述说明
cityid    4840   是    String   城市id

{
	"status": 200,
	"msg": "ok",
	"list": {
		"1": {
			"date": "6/27",
			"week": "今天",
			"max_temp": "35℃",
			"min_temp": "29℃",
			"weather": "雷阵雨",
			"day_icon": "https://i.i8tq.com/e_index/blueTemperature/04.png",
			"night_icon": "https://i.i8tq.com/e_index/blueTemperature/04.png"
		},
		"2": {
			"date": "6/28",
			"week": "星期五",
			"max_temp": "35℃",
			"min_temp": "28℃",
			"weather": "雷阵雨",
			"day_icon": "https://i.i8tq.com/e_index/blueTemperature/04.png",
			"night_icon": "https://i.i8tq.com/e_index/blueTemperature/01_n.png"
		},
		...
		...
		...
		"15": {
			"date": "7/11",
			"week": "星期四",
			"max_temp": "34℃",
			"min_temp": "28℃",
			"weather": "雨",
			"day_icon": "https://i.i8tq.com/e_index/blueTemperature/301.png",
			"night_icon": "https://i.i8tq.com/e_index/blueTemperature/301.png"
		}
	}
}

开发文档参考来源:https://console-docs.apipost.cn/preview/8cafe72ecd5ddecc/7f1676f5f3ea5fa1?target_id=34bc097c-0bdf-4385-bfe6-af251665ede9

技术来源:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值