1. 基本信息
| 接口地址 | https://v1.apizero.cn/api/traffic-weather-alert |
|---|
| 请求方法 | GET |
|---|
| 分类 | life |
|---|
| 提供方 | 极数本源 |
|---|
| 计费模式 | 免费试用 |
|---|
| 单次消耗 | 0 积分 |
|---|
| 起步价 | — |
|---|
| QPS 限制 | 3 req/s |
|---|
| 每日免费额度 | 100 次(已认证用户) |
|---|
| 匿名每日额度 | 50 次(无 API Key) |
|---|
| VIP 免费 | 否 |
|---|
| 调用次数 | |
|---|
3. 请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|
city | string | 是 | 城市拼音(如 beijing/chengdu/hangzhou),兼容中文(如 北京/成都) | beijing |
action | string | 否 | 操作:restriction(默认)/ cities(支持限行的城市列表) | restriction |
5. 请求示例 (cURL)
curl "https://v1.apizero.cn/api/traffic-weather-alert?city=beijing&action=restriction&key=YOUR_API_KEY"
6. 响应字段
| 字段 | 类型 | 说明 | 示例 |
|---|
city | string | 城市拼音 | — |
city_cn | string | 城市中文名 | — |
date | string | 查询日期(ISO) | — |
weekday | string | 今天星期几(中文) | — |
restricted_numbers | string|null | 限行尾号(如 "4,9"),不限行为 null | — |
restriction_active | boolean | 今日是否限行 | — |
weather.weather | string | 天气描述 | — |
weather.temperature | string | 温度(带 °C) | — |
weather.is_severe | boolean | 是否恶劣天气 | — |
weather.severe_type | string|null | 恶劣天气类型(暴雨/台风等) | — |
work_from_home_advisory | string|null | 居家办公建议(无恶劣天气为 null) | — |
message | string | 综合提示 | — |
7. 响应示例
{
"code": 0,
"msg": "成功",
"data": {
"city": "beijing",
"city_cn": "北京",
"date": "2026-05-11",
"weekday": "周一",
"restricted_numbers": "5,0",
"restriction_active": true,
"weather": {
"weather": "晴",
"temperature": "26°C",
"is_severe": false,
"severe_type": null
},
"work_from_home_advisory": null,
"message": "今日北京(周一)限行尾号为 5,0"
},
"request_id": "abc123"
}
8. 错误码
| code | status | 说明 |
|---|
4000 | — | city 缺失或格式不正确 / action 不合法 |
4029 | — | 调用过快(QPS 超限) |
4030 | — | 今日额度用完 |
9. 变更日志
- 1.0.0(2026-05-10)
- 首次上线,6 城限行 + wttr.in 天气 + 恶劣天气联动