天气查询

GET /weather 正常

查询天气情况

请求参数

参数名 类型 必选 描述
city string 必填 城市名(更新后无需再加市/区/县)

请求示例

https://www.cunyuapi.top/weather?city=北京

返回示例

{
  "city_info": {
    "city": "北京市",
    "reporttime": "2025-04-16 17:06:58"
  },
  "forecasts": [
    {
      "date": "2025-04-16",
      "weather": {
        "day": "多云",
        "night": "多云"
      },
      "temperature": {
        "day": "29",
        "night": "12"
      },
      "wind": {
        "day": {
          "direction": "南",
          "power": "1-3"
        },
        "night": {
          "direction": "南",
          "power": "1-3"
        }
      }
    },
    {
      "date": "2025-04-17",
      "weather": {
        "day": "多云",
        "night": "多云"
      },
      "temperature": {
        "day": "28",
        "night": "14"
      },
      "wind": {
        "day": {
          "direction": "北",
          "power": "1-3"
        },
        "night": {
          "direction": "北",
          "power": "1-3"
        }
      }
    },
    {
      "date": "2025-04-18",
      "weather": {
        "day": "阴",
        "night": "小雨"
      },
      "temperature": {
        "day": "20",
        "night": "10"
      },
      "wind": {
        "day": {
          "direction": "南",
          "power": "1-3"
        },
        "night": {
          "direction": "南",
          "power": "1-3"
        }
      }
    },
    {
      "date": "2025-04-19",
      "weather": {
        "day": "阴",
        "night": "晴"
      },
      "temperature": {
        "day": "20",
        "night": "11"
      },
      "wind": {
        "day": {
          "direction": "南",
          "power": "1-3"
        },
        "night": {
          "direction": "南",
          "power": "1-3"
        }
      }
    }
  ]
}