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://api-cf.ewlgc.tophttps://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"
    }
}
上一页
实时天气情况 解析api
下一页
全境天气预报 解析api
Built with