Forecast
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 |
|---|---|---|---|
| Yes | — | Latitude and longitude as path parameter (e.g. |
| No |
| Unit system: |
| No |
| Language code for text summaries |
| No | — | Set to |
| No | — | Comma-separated blocks to exclude: |
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 |
|---|---|---|
| integer | Unix timestamp |
| string | Human-readable summary |
| string | Weather condition code with day/night suffix (e.g. |
| boolean | Whether the data point is during daylight hours |
| float | Temperature |
| float | Feels-like temperature |
| float | Relative humidity (0–1) |
| float | Sea-level pressure (hPa) |
| float | Wind speed |
| integer | Wind direction (0–360°) |
| float | Cloud cover (0–1) |
| 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 |
|---|---|---|
| integer | Unix timestamp (start of day) |
| string | Human-readable daily summary |
| float | Daytime high temperature |
| float | Overnight low temperature |
| integer | Unix timestamp of sunrise |
| integer | Unix timestamp of sunset |
| float | Lunar phase (0 = new moon, 0.5 = full moon) |
| float | Daily precipitation total |
alerts
Array of active weather alerts for the area. Each alert includes title, description, time, expires, and severity.
Units
Measurement |
|
|
|
|
|---|---|---|---|---|
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 |
|---|---|
| Invalid coordinates or parameters |
| Invalid API key |
| Rate limit exceeded |
| Forecast data not loaded |