天气预报

GET
https://v1.nsuuu.com/api/weather
https://v2.xxapi.cn/api/weather?city=枣庄滕州&key=你的key

服务指标

QPS 上限
30次/秒
平均响应时间
203.69ms
今日调用量
0
累计调用量
256

接口描述

免费API提供准确的天气预报服务,支持获取全球各地的实时天气数据,帮助用户了解天气趋势,适用于应用开发、网站集成和个人使用。

请求参数

怎么传递这个 Key?
方法 2:放在请求头 (Header)
直接使用 Authorization,无需前缀
Authorization:Key
方法 3:放在请求头 (Header)
自定义 Header key 字段
key:Key
不推荐
方法 4:放在网址后面 (Query)
不安全,可能泄露 Key,即将弃用
网址?key=Key

相关套餐

请求示例

Shell
JavaScript
Python
PHP
Java
Go
C#
Ruby
curl -X GET 'https://v1.nsuuu.com/api/weather?city=${城市名称}' \
  -H 'Authorization: Bearer YOUR_API_KEY'

返回示例

{
	"code": 200,
	"msg": "数据请求成功",
	"data": {
		"city": "滕州市",
		"data": [
			{
				"date": "周六",
				"temperature": "4-24℃",
				"weather": "多云",
				"wind": "北风4-5级",
				"air_quality": "轻度"
			},
			{
				"date": "周日",
				"temperature": "2-11℃",
				"weather": "晴",
				"wind": "北风4-5级",
				"air_quality": "良"
			},
			{
				"date": "周一",
				"temperature": "5-18℃",
				"weather": "晴",
				"wind": "西南风4-5级",
				"air_quality": "良"
			},
			{
				"date": "周二",
				"temperature": "10-23℃",
				"weather": "多云",
				"wind": "南风3-4级",
				"air_quality": "良"
			},
			{
				"date": "周三",
				"temperature": "5-17℃",
				"weather": "多云",
				"wind": "东北风3-4级",
				"air_quality": "良"
			},
			{
				"date": "周四",
				"temperature": "5-12℃",
				"weather": "小雨",
				"wind": "东风3-4级",
				"air_quality": "良"
			}
		]
	}
}