七天预报 解析api
GET
https://weather.cma.cn/api/weather/view
请求参数
Query 参数
stationid
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/weather/view?stationid=54156'
返回响应
🟢200成功
application/json
Body
msg
string
必需
code
integer
必需
data
object
必需
location
object
必需
daily
array [object {11}]
必需
now
object
必需
alarm
array[string]
必需
lastUpdate
string
必需
示例
{
"msg": "success",
"code": 0,
"data": {
"location": {
"id": "54156",
"name": "公主岭",
"path": "中国, 吉林, 公主岭",
"longitude": 124.8,
"latitude": 43.52,
"timezone": 8
},
"daily": [
{
"date": "2023/12/12",
"high": -12,
"dayText": "晴",
"dayCode": 0,
"dayWindDirection": "东南风",
"dayWindScale": "微风",
"low": -19,
"nightText": "晴",
"nightCode": 0,
"nightWindDirection": "东风",
"nightWindScale": "微风"
},
{
"date": "2023/12/13",
"high": -10,
"dayText": "多云",
"dayCode": 1,
"dayWindDirection": "东北风",
"dayWindScale": "微风",
"low": -15,
"nightText": "多云",
"nightCode": 1,
"nightWindDirection": "东南风",
"nightWindScale": "微风"
},
{
"date": "2023/12/14",
"high": -11,
"dayText": "小雪",
"dayCode": 14,
"dayWindDirection": "东北风",
"dayWindScale": "微风",
"low": -18,
"nightText": "小雪",
"nightCode": 14,
"nightWindDirection": "东北风",
"nightWindScale": "微风"
},
{
"date": "2023/12/15",
"high": -14,
"dayText": "小雪",
"dayCode": 14,
"dayWindDirection": "北风",
"dayWindScale": "4~5级",
"low": -19,
"nightText": "小雪",
"nightCode": 14,
"nightWindDirection": "北风",
"nightWindScale": "微风"
},
{
"date": "2023/12/16",
"high": -16,
"dayText": "晴",
"dayCode": 0,
"dayWindDirection": "西北风",
"dayWindScale": "微风",
"low": -22,
"nightText": "晴",
"nightCode": 0,
"nightWindDirection": "西风",
"nightWindScale": "微风"
},
{
"date": "2023/12/17",
"high": -16,
"dayText": "晴",
"dayCode": 0,
"dayWindDirection": "西风",
"dayWindScale": "微风",
"low": -22,
"nightText": "晴",
"nightCode": 0,
"nightWindDirection": "西南风",
"nightWindScale": "微风"
},
{
"date": "2023/12/18",
"high": -14,
"dayText": "晴",
"dayCode": 0,
"dayWindDirection": "西风",
"dayWindScale": "微风",
"low": -21,
"nightText": "晴",
"nightCode": 0,
"nightWindDirection": "西风",
"nightWindScale": "微风"
}
],
"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:18