The Danish Meteorological Institute (DMI) provides a comprehensive Open Data API for accessing weather information across Denmark. While powerful, their API can be complex to work with directly, requiring multiple endpoints, API keys, and data transformation to get practical weather information.
I built this Laravel-based proxy API to provide a cleaner, more accessible interface to DMI's weather data. The API simplifies access to current weather conditions, forecasts up to 72 hours, and historical weather records with flexible time resolutions.
One of the key features is smart geocoding - you can request weather data using city names, postal codes, or coordinates. The system integrates with DAWA (Danish Address Web API) to automatically convert location names to coordinates, with intelligent caching to ensure fast responses.
The API also includes automatic wind chill calculation using the North American and UK wind chill index formula whenever conditions meet the criteria (temperature at or below 10°C and wind speed above 1.3 m/s). This makes the data more immediately useful for understanding how the weather actually feels.
Performance was a key consideration, so I implemented a comprehensive caching strategy with different TTL values for current weather (5 minutes), forecasts (30 minutes), and historical data (24 hours). This ensures the API remains responsive while minimizing unnecessary calls to DMI's services.