实时天气情况 解析api
GET
https://api-cf.ewlgc.tophttps://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"
}
}