Forecast
Get weather forecast data for any location worldwide.
Overview
The Forecast API returns current conditions, minutely precipitation, hourly and daily forecasts, and weather alerts for a given coordinate.
Endpoint
GET /forecast/{lat},{lon}
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
lat,lon |
Yes | — | Latitude and longitude as path parameter (e.g. 47.37,8.55) |
units |
No | us |
Unit system: us (imperial), si (metric), ca (metric with km/h wind), uk (metric with mph wind), auto (based on country) |
lang |
No | en |
Language code for text summaries |
extend |
No | — | Set to hourly to extend hourly forecast beyond 48 hours |
exclude |
No | — | Comma-separated blocks to exclude: currently, minutely, hourly, daily, alerts |
Example Request
GET /forecast/47.37,8.55?units=si
Example Response
{
"latitude": 47.37,
"longitude": 8.55,
"timezone": "Europe/Zurich",
"offset": 1,
"elevation": 408,
"currently": {
"time": 1709132400,
"summary": "Partly Cloudy",
"icon": "01d",
"is_day": true,
"temperature": 8.2,
"apparentTemperature": 5.1,
"humidity": 0.65,
"pressure": 1018.5,
"windSpeed": 12.3,
"windDirection": 230,
"cloudCover": 0.45,
"visibility": 16.1
},
"hourly": {
"summary": "Partly cloudy throughout the day.",
"icon": "01d",
"data": [
{
"time": 1709132400,
"summary": "Partly Cloudy",
"icon": "01d",
"is_day": true,
"temperature": 8.2,
"apparentTemperature": 5.1,
"humidity": 0.65,
"pressure": 1018.5,
"windSpeed": 12.3,
"windDirection": 230,
"cloudCover": 0.45,
"precipitation": 0,
"precipitationType": "none"
}
]
},
"daily": {
"summary": "Partly cloudy for the week.",
"icon": "01d",
"data": [
{
"time": 1709082000,
"summary": "Partly cloudy throughout the day.",
"icon": "01d",
"is_day": true,
"temperatureHigh": 11.5,
"temperatureLow": 3.2,
"humidity": 0.62,
"pressure": 1018.5,
"windSpeed": 15.1,
"windDirection": 240,
"cloudCover": 0.4,
"precipitation": 0,
"sunriseTime": 1709101200,
"sunsetTime": 1709139600,
"moonPhase": 0.62
}
]
},
"alerts": []
}
Response Blocks
currently
Current weather conditions at the requested location.
| Field | Type | Description |
|---|---|---|
time |
integer | Unix timestamp |
summary |
string | Human-readable summary |
icon |
string | Weather condition code with day/night suffix (e.g. "01d", "07n"). See Weather Icons. |
is_day |
boolean | Whether the data point is during daylight hours |
temperature |
float | Temperature |
apparentTemperature |
float | Feels-like temperature |
humidity |
float | Relative humidity (0–1) |
pressure |
float | Sea-level pressure (hPa) |
windSpeed |
float | Wind speed |
windDirection |
integer | Wind direction (0–360°) |
cloudCover |
float | Cloud cover (0–1) |
visibility |
float | Visibility distance |
hourly
Hourly forecast for the next 48 hours (or extended with extend=hourly). Each item in data contains the same fields as currently.
daily
Daily forecast for the next 7 days. Each item in data includes:
| Field | Type | Description |
|---|---|---|
time |
integer | Unix timestamp (start of day) |
summary |
string | Human-readable daily summary |
temperatureHigh |
float | Daytime high temperature |
temperatureLow |
float | Overnight low temperature |
sunriseTime |
integer | Unix timestamp of sunrise |
sunsetTime |
integer | Unix timestamp of sunset |
moonPhase |
float | Lunar phase (0 = new moon, 0.5 = full moon) |
precipitation |
float | Daily precipitation total |
alerts
Array of active weather alerts for the area. Each alert includes title, description, time, expires, and severity.
Units
| Measurement | us |
si |
ca |
uk |
|---|---|---|---|---|
| Temperature | °F | °C | °C | °C |
| Wind speed | mph | m/s | km/h | mph |
| Precipitation | in/hr | mm/hr | mm/hr | mm/hr |
| Visibility | mi | km | km | mi |
| Elevation | ft | m | m | m |
Errors
| Status | Description |
|---|---|
400 |
Invalid coordinates or parameters |
403 |
Invalid API key |
429 |
Rate limit exceeded |
503 |
Forecast data not loaded |