api-cf
  1. 天气
api-cf
  • api-cf 公共接口文档
  • 建站实用
    • 随机动漫壁纸
      GET
    • 二维码生成
      POST
    • bing-wallpaper
      POST
    • bing wallpaper 解析api
      GET
  • 天气
    • 获取IP
      GET
    • 获取地区代码
      POST
    • 获取实时天气
      POST
    • IP转地址(精确) 解析api
      GET
    • 实时天气情况 解析api
      GET
    • 七天预报 解析api
      GET
    • 全境天气预报 解析api
      GET
  • Genshin
    • 数据结构说明
    • 获取角色展柜以及玩家信息
      GET
    • 获取玩家信息
      GET
  1. 天气

实时天气情况 解析api

GET
https://weather.cma.cn/api/now/{regionid}
返回请求地区的实时天气数据

请求参数

Path 参数
regionid
string 
地区代码
必需
示例值:
54156

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://weather.cma.cn/api/now/54156'

返回响应

🟢200成功
application/json
Body
msg
string 
必需
code
integer 
必需
data
object 
必需
location
object 
必需
now
object 
必需
alarm
array[string]
必需
lastUpdate
string 
必需
示例
{
  "msg": "success",
  "code": 0,
  "data": {
    "location": {
      "id": "54156",
      "name": "公主岭",
      "path": "中国, 吉林, 公主岭"
    },
    "now": {
      "precipitation": 0,
      "temperature": -14.1,
      "pressure": 1005,
      "humidity": 46,
      "windDirection": "东北风",
      "windDirectionDegree": 46,
      "windSpeed": 2.6,
      "windScale": "微风"
    },
    "alarm": [],
    "lastUpdate": "2023/12/12 17:30"
  }
}
修改于 2023-12-17 13:01:11
上一页
IP转地址(精确) 解析api
下一页
七天预报 解析api
Built with