Docs
View as Markdown

openmeteo.forecast_daily

stable Advanced

Daily forecast (columnar arrays) for up to 16 days.

GET /v1/openmeteo/forecast_daily

What you get#

One Openmeteo record in Onekey's unified shape, in data. If the record does not exist you get a 404 not_found and are not charged.

What it costs#

  • Advanced · 5 credits for a fresh fetch, charged only when it succeeds.
  • Free when served from cache (0.2 credit for a cached response over 100 KB).
  • Free if the request is invalid (never charged) or the source fails or reports not found (refunded).

Parameters#

NameTypeRequiredDefaultWhat it isConstraints
latstringyes(required)Latitude in decimal degrees (-90..90)max 10 chars; must match -?(?:[0-8]?\d(?:\.\d{1,6})?|90(?:\.0{1,6})?); trimmed
lonstringyes(required)Longitude in decimal degrees (-180..180)max 11 chars; must match -?(?:1[0-7]\d(?:\.\d{1,6})?|\d{1,2}(?:\.\d{1,6})?|180(?:\.0{1,6})?); trimmed
daysstringno7Forecast days (1-16)max 2 chars; must match [1-9]|1[0-6]; trimmed

Request#

curl "https://api.onekey.dev/v1/openmeteo/forecast_daily?lat=52.52&lon=13.41" \
  -H "x-api-key: YOUR_API_KEY"

Try it

Add your key to run this call right here. No key? Get one free. The key stays in this tab.

Recorded response#

A real Openmeteo response, recorded and returned in Onekey's shape. Fields the platform does not provide are null.

json
{
  "success": true,
  "data": {
    "place": {
      "lat": 52.52,
      "lon": 13.419998,
      "timeZone": "Europe/Berlin"
    },
    "ext": {
      "dates": [
        "2026-09-28",
        "2026-09-29",
        "2026-09-30",
        "2026-10-01",
        "2026-10-02",
        "2026-10-03",
        "2026-10-04"
      ],
      "weatherCode": [
        3,
        3,
        3,
        3,
        61,
        3,
        3
      ],
      "temperatureMaxC": [
        24.7,
        25.1,
        23.7,
        22.2,
        20.7,
        20.7,
        21.4
      ],
      "temperatureMinC": [
        12.4,
        13.6,
        13.1,
        12.3,
        15.2,
        13.6,
        13
      ],
      "sunrise": [
        "2026-09-28T07:02",
        "2026-09-29T07:03",
        "2026-09-30T07:05",
        "2026-10-01T07:07",
        "2026-10-02T07:09",
        "2026-10-03T07:10",
        "2026-10-04T07:12"
      ],
      "sunset": [
        "2026-09-28T18:50",
        "2026-09-29T18:48",
        "2026-09-30T18:46",
        "2026-10-01T18:43",
        "2026-10-02T18:41",
        "2026-10-03T18:38",
        "2026-10-04T18:36"
      ],
      "uvIndexMax": [
        3.45,
        3.75,
        3.35,
        3.1,
        3.1,
        3.5,
        2.45
      ],
      "precipitationSumMm": [
        0,
        0,
        0,
        0,
        0.9,
        0,
        0
      ],
      "precipitationProbabilityMaxPct": [
        0,
        0,
        0,
        6,
        10,
        3,
        8
      ],
      "windSpeedMaxKmH": [
        12,
        14.8,
        17.5,
        10.5,
        8.4,
        6.5,
        6.8
      ]
    }
  },
  "metadata": {
    "platform": "openmeteo",
    "endpoint": "forecast_daily",
    "cached": false,
    "stale": false,
    "age_s": 0,
    "fetched_at": "2026-01-01T12:00:00+00:00",
    "credits_charged": 5,
    "request_id": "7f3a9c2e5b1d4c8fa2e6d0b9c4f18e37"
  },
  "error": null
}

Field mapping#

How this endpoint's source fields become Onekey's unified schema. Fields the source lacks come back as null.

Source pathOnekey fieldTransform
latitudeplace.lattoNumber
longitudeplace.lontoNumber
timezoneplace.timeZone-
daily.timeext.dates-
daily.weather_codeext.weatherCode-
daily.temperature_2m_maxext.temperatureMaxC-
daily.temperature_2m_minext.temperatureMinC-
daily.sunriseext.sunrise-
daily.sunsetext.sunset-
daily.uv_index_maxext.uvIndexMax-
daily.precipitation_sumext.precipitationSumMm-
daily.precipitation_probability_maxext.precipitationProbabilityMaxPct-
daily.wind_speed_10m_maxext.windSpeedMaxKmH-

Caching and freshness#

  • Fresh for about 2 minutes. Repeat calls in that window are served from cache and are free.
  • Between 2 minutes and 15 minutes the cached copy is still served instantly and marked stale: true while Onekey refreshes it in the background.
  • If the source is down when a refresh is needed, the last copy can be served for up to 1 hour more (marked stale).
  • A "not found" is remembered for 1 minute and is free.
  • The cache is shared across all customers, which is what keeps repeat calls cheap.

What can go wrong#

StatusCodeWhat to do
401unauthorizedCheck the x-api-key header.
402insufficient_creditsAdd credits; your balance must cover the price.
404not_foundThat record does not exist. Free; do not retry.
422invalid_paramsFix the parameters using the table above. Free.
429rate_limitedWait Retry-After seconds, then retry.
502upstream_errorThe source failed. Refunded; retry with backoff.

See Errors for the full list and retry guidance.

Status: stable (verified against the live source).