Location Formats
All endpoints accept a location path parameter in these formats:
| Format | Example | Description |
|---|---|---|
| City Name | copenhagen, københavn, aarhus |
Danish city names (case-insensitive) |
| Postal Code | 1000, 8000, 5000 |
4-digit Danish postal codes |
| Coordinates | 55.6761,12.5683 |
Latitude and longitude (comma-separated) |
Wind Chill
Wind chill is automatically calculated using the North American and UK wind chill index formula when:
- Temperature is at or below 10°C
- Wind speed is above 1.3 m/s (4.68 km/h)
If conditions don't meet these criteria, wind chill fields are omitted from the response.
Formula:
Wind Chill (°C) = 13.12 + 0.6215T - 11.37V^0.16 + 0.3965TV^0.16
Where:
T = Air temperature (°C)
V = Wind speed (km/h)
Caching
- Current weather: 5 minutes
- Forecast: 30 minutes
- Historical: 24 hours
- Geocoding: 24 hours
Endpoints
GET
/api/weather/current/{location}
Get current weather conditions for a location in Denmark.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
location |
string | City name, postal code, or coordinates (lat,lon) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parameters[] |
array | Optional |
Weather parameters to include. If omitted, all are returned.
Values: temperature, humidity, wind, pressure |
Example Response
{
"location": {
"name": "Copenhagen",
"coordinates": {
"lat": 55.6761,
"lon": 12.5683
},
"station": "Copenhagen"
},
"timestamp": "2025-01-15T12:00:00+00:00",
"temperature": {
"value": 15.2,
"unit": "celsius"
},
"humidity": 65,
"wind": {
"speed": 5.5,
"direction": 180,
"unit": "meters_per_second",
"chill": 3.2,
"chill_unit": "celsius"
},
"pressure": {
"value": 1013.25,
"unit": "hectopascals"
}
}
Try it out
ExpandHold Ctrl/Cmd to select multiple
Response
GET
/api/weather/forecast/{location}
Get weather forecast (up to 72 hours) for a location in Denmark.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
location |
string | City name, postal code, or coordinates (lat,lon) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hours |
integer | Optional |
Number of hours to forecast.
Default: 48
|
Example Response
{
"location": {
"name": "aarhus",
"coordinates": {
"lat": 56.1629,
"lon": 10.2039
}
},
"generated_at": "2025-01-15T12:00:00+00:00",
"forecast": [
{
"timestamp": "2025-01-15T13:00:00+00:00",
"temperature": 14.5,
"wind_speed": 6,
"wind_direction": 190,
"wind_chill": 3.8,
"precipitation": 0.5,
"cloud_cover": 50
}
]
}
Try it out
Expand
Response
GET
/api/weather/historical/{location}
Get historical weather data for a location in Denmark.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
location |
string | City name, postal code, or coordinates (lat,lon) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from |
date | Required | Start date (YYYY-MM-DD) |
to |
date | Required | End date (YYYY-MM-DD). Must be after from. |
resolution |
string | Optional |
Time resolution for aggregation.
Values: hour, day, month, year Default: day
|
parameters[] |
array | Optional |
Weather parameters to include. If omitted, all are returned.
Values: temperature, precipitation, wind, humidity, sunshine |
Example Response
{
"location": {
"name": "odense",
"coordinates": {
"lat": 55.4038,
"lon": 10.4024
},
"station": "Odense"
},
"period": {
"from": "2024-01-01T00:00:00+00:00",
"to": "2024-01-31T00:00:00+00:00",
"resolution": "day"
},
"data": [
{
"timestamp": "2024-01-01T00:00:00+00:00",
"temperature": 5.5,
"precipitation": 2.3,
"wind_speed": 4.5,
"wind_chill": 1.2
}
]
}
Try it out
ExpandHold Ctrl/Cmd to select multiple
Response
Error Responses
400 Bad Request
{
"error": "Unable to geocode location: unknowncity",
"location": "unknowncity"
}
422 Unprocessable Entity
{
"message": "The from field is required.",
"errors": {
"from": [
"The from field is required."
]
}
}