← 地理与天气

天气预报

GET /weather/forecast

获取最多 16 天的多天天气预报,含每日最高/最低温度、降水概率、风速和天气代码。支持坐标或城市名称查询。适用于旅行规划应用、活动安排工具、农业仪表板和帮助用户围绕未来天气条件进行规划的任何功能。数据来自 Open-Meteo 预报模型。

参数

lat 可选

Latitude

lon 可选

Longitude

city 可选

City name

days 可选 默认: 7

Forecast days

请求示例

基本用法
curl "https://nordapi.ee/api/v1/weather/forecast?city=tokyo&days=7"
7-day forecast for Tokyo
curl "https://nordapi.ee/api/v1/weather/forecast?city=tokyo&days=7"
3-day forecast for London
curl "https://nordapi.ee/api/v1/weather/forecast?city=london&days=3"
16-day forecast by coordinates (Sydney)
curl "https://nordapi.ee/api/v1/weather/forecast?lat=-33.87&lon=151.21&days=16"
Default forecast for Oslo
curl "https://nordapi.ee/api/v1/weather/forecast?city=oslo"

实时响应

{
  "city": "tokyo",
  "data": {
    "daily": {
      "precipitation_sum": [
        0.0,
        0.0,
        0.0,
        0.0,
        0.3,
        0.0,
        0.0
      ],
      "temperature_2m_max": [
        21.9,
        23.0,
        27.2,
        25.4,
        23.0,
        23.3,
        23.3
      ],
      "temperature_2m_min": [
        15.6,
        16.3,
        19.9,
        17.5,
        14.9,
        13.6,
        15.1
      ],
      "time": [
        "2026-10-04",
        "2026-10-05",
        "2026-10-06",
        "2026-10-07",
        "2026-10-08",
        "2026-10-09",
        "2026-10-10"
      ],
      "weather_code": [
        2,
        3,
        2,
        3,
        51,
        0,
        3
      ],
      "wind_speed_10m_max": [
        6.2,
        6.9,
        9.9,
        15.8,
        8.2,
        8.1,
        10.1
      ]
    },
    "daily_units": {
      "precipitation_sum": "mm",
      "temperature_2m_max": "°C",
      "temperature_2m_min": "°C",
      "time": "iso8601",
      "weather_code": "wmo code",
      "wind_speed_10m_max": "km/h"
    },
    "elevation": 37.0,
    "generationtime_ms": 0.2764463424682617,
    "latitude": 35.7,
    "longitude": 139.625,
    "timezone": "Asia/Tokyo",
    "timezone_abbreviation": "GMT+9",
    "utc_offset_seconds": 32400
  },
  "success": true
}