天气查询

GET
https://api.auth.top/api/weather
https://api.auth.top/api/weather

服务指标

QPS 上限
30次/秒
平均响应时间
1.13ms

接口描述

提供城市的实时天气、精准预报、空气质量监测及个性化生活指数提醒服务。

请求参数

怎么传递这个 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://api.auth.top/api/weather?city=${城市名称}&format=${json}' \
  -H 'Authorization: Bearer YOUR_API_KEY'

返回示例

{
  "code": 0,
  "msg": "查询成功",
  "data": {
    "province": "海南",
    "city": "三亚市",
    "weather": "晴",
    "temperature": "22",
    "humidity": "43",
    "winddirection": "北",
    "windpower": "4",
    "reporttime": "2026-01-09 11:34:33"
  }
}