PHPackages                             rugaard/dmi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rugaard/dmi

ActiveLibrary[API Development](/categories/api)

rugaard/dmi
===========

API for the Danish Meteorological Institute (DMI)

1.1.11(1y ago)164492MITPHPPHP ^7.2|^8.0|^8.1|^8.2|^8.3CI failing

Since Jul 9Pushed 2w ago2 watchersCompare

[ Source](https://github.com/rugaard/dmi)[ Packagist](https://packagist.org/packages/rugaard/dmi)[ Docs](https://github.com/rugaard)[ RSS](/packages/rugaard-dmi/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (20)Used By (0)

[![](https://camo.githubusercontent.com/33b6ec9e050adb1e19ba5d1802712052e5a07c435906095db48718e3906c3d17/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f6c6f676f2e6a7067)](https://camo.githubusercontent.com/33b6ec9e050adb1e19ba5d1802712052e5a07c435906095db48718e3906c3d17/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f6c6f676f2e6a7067)

🇩🇰🌤️ Danish Meteorological Institute (DMI) API.
===============================================

[](#️-danish-meteorological-institute-dmi-api)

[![](https://camo.githubusercontent.com/e6d8b4e449536a113374267b4a73517880a10cc4fa93517d315a57f1866facf4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f727567616172642f646d692e737667)](https://github.com/rugaard/dmi/releases)[![](https://camo.githubusercontent.com/b725fcf83c91eca536216c93dc2934483a8f3129ff43947a8d677031bad7b3b6/68747470733a2f2f7472617669732d63692e6f72672f727567616172642f646d692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rugaard/dmi)[![](https://camo.githubusercontent.com/504604e72e061c387ba947dd318805019edbf9c8b39570934446a9052b0cab24/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f727567616172642f646d692e737667)](https://codeclimate.com/github/rugaard/dmi)[![](https://camo.githubusercontent.com/b7034202a0167700e3f3ddd98d0172271e76ba50ee4e15165a65021f3bd0494e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f727567616172642f646d692e737667)](https://codeclimate.com/github/rugaard/dmi)[![](https://camo.githubusercontent.com/cfcbaa058880bc251c911bc111f70b161634f10aa1643b817a759ccd7378d8b5/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76312e7376673f6c6162656c436f6c6f723d356635663566266c6162656c3d6c6963656e736526636f6c6f723d343338393761266d6573736167653d434325323042592d4e432d4e44)](https://creativecommons.org/licenses/by-nc-nd/4.0/)

The Danish Meteorological Institute (DMI) does unfortunately not offer an official API ([yet](#%EF%B8%8F-disclaimer)).

This package is (in some form) a workaround for that. It collects all weather data (forecasts and archived) from the official DMI website and turns it into structured data objects.

***Note: Since the data is being extracted from a the website, there is a risk of the package could stop working, if the website does any breaking changes.***

***Should this happen, please don't hesitate to [create an issue](https://github.com/rugaard/dmi/issues/new) and I will look into it as quickly as possible***

⚠️ Disclaimer
-------------

[](#️-disclaimer)

As part of the danish governments desire to become one of the *digital frontrunners*, they have decided that the Danish Meteorological Institute (DMI) has to make all of their data available to the public.

The data will be released in multiple stages over the **next 3 years**, starting from **Q3 in 2019** until **Q4 in 2022**. Unfortunately there is not much information on how the data will be released.

Depending on how the data will be released, this package will be subject to changes in the future.

**Since the data is not officially released, this package is made available under a very strict license, which prohibits any use other than personal.**

When DMI releases the data publicly, the license will be changed to a more open source-friendly (MIT) version.

📖 Table of contents
-------------------

[](#-table-of-contents)

- [Features](#-features)
- [Installation](#-installation)
    - [Laravel](#laravel)
- [Usage](#%EF%B8%8F-usage)
    - [DMI Client](#dmi-client)
    - [Methods](#methods)
        - [National forecast](#national-forecast)
        - [Extended national forecast](#extended-national-forecast)
        - [Search locations](#search-locations)
        - [Location by ID](#location-by-id)
        - [Location by coordinate](#location-by-coordinate)
        - [Weather warnings](#weather-warnings)
        - [Sun times](#sun-times)
        - [UV index](#uv-index)
        - [Pollen](#pollen)
        - [Sea stations](#sea-stations)
        - [Sea station by ID](#sea-station-by-id)
        - [Archived weather data](#archived-weather-data)
- [Icons](#-icons)
    - [Day](#day-after-sunrise)
    - [Night](#night-after-sunset)
- [Municipalities](#-municipalities)
- [Frequently Asked Questions (FAQ)](#-frequently-asked-questions-faq)
    - [How do I find the ID of a pre-defined location?](#how-do-i-find-the-id-of-a-pre-defined-location)
    - [What is this `Tightenco\Collect\Support\Collection` class and how does it work?](#what-is-this-tightencocollectsupportcollection-class-and-how-does-it-work)
- [Roadmap](#-roadmap)
    - [Internal caching](#internal-caching)
- [License](#-license)

🚀 Features
----------

[](#-features)

NameDescriptionSupportedNational forecastsNational descriptive forecasts (incl. 7 days forecast)✅SearchSearch pre-defined locations✅LocationWeather data/forecast for a pre-defined location✅Location by coordinateWeather data/forecast for a location based on coordinates *(latitude/longitude)*✅Weather warningsNational weather warnings✅Sun timesTime of sunrise and sunset✅UV indexCurrent UV index✅PollenCurrent Pollen measurements✅Sea stationsAll national sea stations and their observations and forecasts✅Sea station by IDObservations and forecasts from a specific sea station✅ArchiveHourly, daily, monthly and yearly data from the DMI archive✅SatelliteSatellite imagery❌Maritime forecastsForecasts around the coasts of Denmark, Greenland &amp; Faroe Islands❌Ice chartsIce charts along the coasts of Greenland❌📦 Installation
--------------

[](#-installation)

You can install the package via [Composer](https://getcomposer.org/), by using the following command:

```
composer require rugaard/dmi
```

### Laravel

[](#laravel)

This package comes with a out-of-the-box Service Provider for the [Laravel](http://laravel.com) framework. If you're using a newer version of Laravel (`>= 5.5`) then the service provider will loaded automatically.

Are you using an older version, then you need to manually add the service provider to the `config/app.php` file:

```
'providers' => [
    Rugaard\DMI\Providers\Laravel\ServiceProvider::class,
]
```

⚙️ Usage
--------

[](#️-usage)

First thing you need to do, is to instantiate the `DMI` client

```
# Instantiate the DMI client.
$dmi = new \Rugaard\DMI\DMI;
```

Once you've done that, you're able to request one or more of the supported features:

```
# National forecast.
$forecast = $dmi->forecast();

# Location by coordinate.
$location = $dmi->locationByCoordinate(55.67594, 12.56553);

# National warnings.
$warnings = $dmi->warnings();
```

### DMI client

[](#dmi-client)

The DMI client which handles all request DMI.

```
new DMI(?int $defaultLocationId, ?Client $httpClient);
```

ParameterTypeDefaultDescription`$defaultLocationId``int``null`Set default location ID`$httpClient``\GuzzleHttp\ClientInterface``null`Replace the default underlying HTTP Client### Methods

[](#methods)

#### National forecast

[](#national-forecast)

Get the latest national descriptive forecast.

```
forecast();
```

#### Extended national forecast

[](#extended-national-forecast)

Get the extended (*7-days*) national descriptive forecast.

```
extendedForecast();
```

#### Search locations

[](#search-locations)

Search locations by name.

```
search(string $query, int $limit);
```

ParameterTypeDefaultDescription`$query``string`-Search query`$limit``int``20`Max. number of locations to return.#### Location by ID

[](#location-by-id)

Get current weather condition and latest forecast for a pre-defined location.

*Note: `$includeRegional` is required to get `municipality` and `region` of location.*

```
location(?int $locationId, bool $includeRegional, bool $includeWarnings);
```

ParameterTypeDefaultDescription`$locationId``int``null`ID of location *(If `null`, it'll use the default location ID from the `DMI` client.)*`$includeRegional``bool``true`Include regional data and forecast for location `*``$includeWarnings``bool``true`Include weather warnings specific for location `*`*`*` Makes additional request to DMI.*

#### Location by coordinate

[](#location-by-coordinate)

Get current weather condition and latest forecast for a location specified by coordinates.

*Note: `$includeRegional` is required to get `municipality` and `region` of location.*

```
locationByCoordinate(float $latitude, float $longitude, bool $includeRegional, bool $includeWarnings);
```

ParameterTypeDefaultDescription`$latitude``float`-Latitude part of coordinate`$longitude``float`-Longitude part of coordinate`$includeRegional``bool``true`Include regional data and forecast for location `*``$includeWarnings``bool``true`Include weather warnings specific for location `*`*`*` Makes additional request to DMI.*

#### Weather warnings

[](#weather-warnings)

Get national weather warnings.

```
warnings();
```

#### Sun times

[](#sun-times)

Get time of the sunrise and sunset, for the next 14 days, for a pre-defined location.

```
sunTimes(?int $locationId);
```

ParameterTypeDefaultDescription`$locationId``int``null`ID of location *(If `null`, it'll use the default location ID from the `DMI` client.)*#### UV index

[](#uv-index)

Get the current UV index for a pre-defined location.

```
uv(?int $locationId);
```

ParameterTypeDefaultDescription`$locationId``int``null`ID of location *(If `null`, it'll use the default location ID from the `DMI` client.)*#### Pollen

[](#pollen)

Get the current national pollen measurements.

```
pollen();
```

#### Sea stations

[](#sea-stations)

Get all sea stations belonging to DMI.

```
seaStations(bool $withObservations, bool $withForecast);
```

ParameterTypeDefaultDescription`$withObservations``bool``false`Include observation data from each station `*``$withForecast``bool``false`Include forecast data for each station `*`*`*` Makes additional request to DMI.*

#### Sea station by ID

[](#sea-station-by-id)

Get a specific sea stations.

```
seaStation(int $stationId, bool $withObservations, bool $withForecast);
```

ParameterTypeDefaultDescription`$stationId``int`-ID of sea station`$withObservations``bool``false`Include observation data from each station `*``$withForecast``bool``false`Include forecast data for each station `*`*`*` Makes additional request to DMI.*

#### Archived weather data

[](#archived-weather-data)

Get archived weather data.

```
archive(string $measurement, string $frequency, $period, ?int $municipalityId, string $country);
```

ParameterTypeDefaultDescription`$measurement``string`-`temperature`, `precipitation`, `wind`, `wind-direction`, `humidity`, `pressure`, `sun`, `drought`, `lightning` or `snow``$frequency``string`-`hourly`, `daily`, `monthly` or `yearly``$period``string` or `DateTime`-`hourly`/`daily` = `YYYY-mm-dd`, `monthly` = `YYYY-mm`
or `yearly` = `YYYY``$municipalityId``int``null`Limit archived data to a specific municipality. [See the full list of available municipality IDs](#-municipalities)`$country``string``DK``DK` = Denmark, `GL` = Greenland, `FO` = Faroe Islands🌤 Icons
-------

[](#-icons)

When getting weather data from a [location](#location-by-id), the response will contain an `$icon` value. The purpose of this value is to determine which icon represents the current weather conditions.

In the table below is a list of all possible icons and values. Each icon is associated with a suggested emoji or image.

I would recommend downloading the free icon pack from [Pixel Perfect](https://www.flaticon.com/packs/weather-97), since it's one of the few ones, that both contains a day and night version of each condition - while still being free.

### Day *(after sunrise)*

[](#day-after-sunrise)

ConditionValueEmojiImageClear`clear`☀️[![](https://camo.githubusercontent.com/e5fe8c408d184cc164c45ee1b5a04d464371b5d2f27e4c346168d15c605490d7/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722e737667)](https://camo.githubusercontent.com/e5fe8c408d184cc164c45ee1b5a04d464371b5d2f27e4c346168d15c605490d7/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722e737667)Partly cloudy`partly-cloudy`⛅️[![](https://camo.githubusercontent.com/6cd801a64477d0bdc500c2fc27624fb191213047cf6265b58831e5f7d7ca45b9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f706172746c792d636c6f7564792e737667)](https://camo.githubusercontent.com/6cd801a64477d0bdc500c2fc27624fb191213047cf6265b58831e5f7d7ca45b9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f706172746c792d636c6f7564792e737667)Cloudy`cloudy`☁️[![](https://camo.githubusercontent.com/d2d9e9021a9d3545f8e5bef1f34cd6d16f32d5b8dd37fbdbd0e9ac042c6dde58/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6f7564792e737667)](https://camo.githubusercontent.com/d2d9e9021a9d3545f8e5bef1f34cd6d16f32d5b8dd37fbdbd0e9ac042c6dde58/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6f7564792e737667)Foggy or misty`foggy`🌫[![](https://camo.githubusercontent.com/8e57375be6563a291382b128fa2611a2a2bf32dac383ab4b9faf30b70f637f14/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f666f6767792e737667)](https://camo.githubusercontent.com/8e57375be6563a291382b128fa2611a2a2bf32dac383ab4b9faf30b70f637f14/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f666f6767792e737667)Thunderstorm`thunderstorm`️️ ⛈[![](https://camo.githubusercontent.com/f2e232876b8c84d68cb3c0e759ffb3bdc8a2ded03b9681bd49cc5bb21432aa53/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f7468756e64657273746f726d2e737667)](https://camo.githubusercontent.com/f2e232876b8c84d68cb3c0e759ffb3bdc8a2ded03b9681bd49cc5bb21432aa53/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f7468756e64657273746f726d2e737667)Clear with light rain`clear-light-rain`️ 🌧[![](https://camo.githubusercontent.com/0b0dd1f0ed2669d836c8bc1154e6cd183d2d964f6bd4d9b2b82fe691b032e5b6/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6c696768742d7261696e2e737667)](https://camo.githubusercontent.com/0b0dd1f0ed2669d836c8bc1154e6cd183d2d964f6bd4d9b2b82fe691b032e5b6/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6c696768742d7261696e2e737667)Light rain`light-rain`️ 🌧[![](https://camo.githubusercontent.com/fba763c5787a82616ad7ad28107a9f68aaaebfdad9b8102a53a7d7849857396a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f6c696768742d7261696e2e737667)](https://camo.githubusercontent.com/fba763c5787a82616ad7ad28107a9f68aaaebfdad9b8102a53a7d7849857396a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f6c696768742d7261696e2e737667)Clear with heavy rain`clear-heavy-rain`️ 🌧[![](https://camo.githubusercontent.com/6fb35d4cf5aa9d225db53e7c14b5091473712f4b38ea4bf778cbb2510a0828d9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d68656176792d7261696e2e737667)](https://camo.githubusercontent.com/6fb35d4cf5aa9d225db53e7c14b5091473712f4b38ea4bf778cbb2510a0828d9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d68656176792d7261696e2e737667)Heavy rain`heavy-rain`️ 🌧[![](https://camo.githubusercontent.com/48987ee1c1e11f603bb318bd03db4c3ee527cc6f422986f6c18940c13a0e783a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f68656176792d7261696e2e737667)](https://camo.githubusercontent.com/48987ee1c1e11f603bb318bd03db4c3ee527cc6f422986f6c18940c13a0e783a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f68656176792d7261696e2e737667)Clear with light sleet`clear-light-sleet`️️ 🌨[![](https://camo.githubusercontent.com/5bc01da195347a397a8522e24808e91e5c3964507723b27efcb2dfd9c3c44525/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742e737667)](https://camo.githubusercontent.com/5bc01da195347a397a8522e24808e91e5c3964507723b27efcb2dfd9c3c44525/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742e737667)Light sleet`light-sleet`️️ 🌨[![](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)Clear with heavy sleet`clear-heavy-sleet`️️ 🌨[![](https://camo.githubusercontent.com/5bc01da195347a397a8522e24808e91e5c3964507723b27efcb2dfd9c3c44525/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742e737667)](https://camo.githubusercontent.com/5bc01da195347a397a8522e24808e91e5c3964507723b27efcb2dfd9c3c44525/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742e737667)Heavy sleet`heavy-sleet`️️ 🌨[![](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)Clear with light snow`clear-light-snow`️️ ☃️[![](https://camo.githubusercontent.com/d0babba84f0756250dac089614325c73bf465b2b032b818f3874909c3c8aac78/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772e737667)](https://camo.githubusercontent.com/d0babba84f0756250dac089614325c73bf465b2b032b818f3874909c3c8aac78/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772e737667)Light snow`light-snow`️️ ☃️[![](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)Clear with heavy snow`clear-heavy-snow`️️ ☃️[![](https://camo.githubusercontent.com/d0babba84f0756250dac089614325c73bf465b2b032b818f3874909c3c8aac78/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772e737667)](https://camo.githubusercontent.com/d0babba84f0756250dac089614325c73bf465b2b032b818f3874909c3c8aac78/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772e737667)Heavy snow`heavy-snow`️️ ☃️[![](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)Blowing snow`blowing-snow`️️ 🌬[![](https://camo.githubusercontent.com/a21822cd14772b9c61fa787577ee1f680816a5033a14649a351b434a8d7c6dc0/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f626c6f77696e672d736e6f772e737667)](https://camo.githubusercontent.com/a21822cd14772b9c61fa787577ee1f680816a5033a14649a351b434a8d7c6dc0/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f626c6f77696e672d736e6f772e737667)### Night *(after sunset)*

[](#night-after-sunset)

ConditionValueEmojiIconClear`clear-night`🌕️[![](https://camo.githubusercontent.com/e3e41ef80fb7841f5721bbf6f380ab3c63fbfa37976ee8691930ef39d702bc4a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6e696768742e737667)](https://camo.githubusercontent.com/e3e41ef80fb7841f5721bbf6f380ab3c63fbfa37976ee8691930ef39d702bc4a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6e696768742e737667)Partly cloudy`partly-cloudy-night`⛅️[![](https://camo.githubusercontent.com/e9e439b1283886bd31c405f7d3a03153daeeff6b3818bf015d320b920e0ccdc3/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f706172746c792d636c6f7564792d6e696768742e737667)](https://camo.githubusercontent.com/e9e439b1283886bd31c405f7d3a03153daeeff6b3818bf015d320b920e0ccdc3/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f706172746c792d636c6f7564792d6e696768742e737667)Cloudy`cloudy-night`☁️[![](https://camo.githubusercontent.com/d2d9e9021a9d3545f8e5bef1f34cd6d16f32d5b8dd37fbdbd0e9ac042c6dde58/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6f7564792e737667)](https://camo.githubusercontent.com/d2d9e9021a9d3545f8e5bef1f34cd6d16f32d5b8dd37fbdbd0e9ac042c6dde58/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6f7564792e737667)Foggy or misty`foggy-night`🌫[![](https://camo.githubusercontent.com/8e57375be6563a291382b128fa2611a2a2bf32dac383ab4b9faf30b70f637f14/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f666f6767792e737667)](https://camo.githubusercontent.com/8e57375be6563a291382b128fa2611a2a2bf32dac383ab4b9faf30b70f637f14/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f666f6767792e737667)Thunderstorm`thunderstorm-night`️️ ⛈[![](https://camo.githubusercontent.com/f2e232876b8c84d68cb3c0e759ffb3bdc8a2ded03b9681bd49cc5bb21432aa53/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f7468756e64657273746f726d2e737667)](https://camo.githubusercontent.com/f2e232876b8c84d68cb3c0e759ffb3bdc8a2ded03b9681bd49cc5bb21432aa53/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f7468756e64657273746f726d2e737667)Clear with light rain`clear-light-rain-night`️ 🌧[![](https://camo.githubusercontent.com/209d48912458d6e81636e512ccef0c929cab2f20e49c5025dd9136df4fb4f5f9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6c696768742d7261696e2d6e696768742e737667)](https://camo.githubusercontent.com/209d48912458d6e81636e512ccef0c929cab2f20e49c5025dd9136df4fb4f5f9/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d6c696768742d7261696e2d6e696768742e737667)Light rain`light-rain-night`️ 🌧[![](https://camo.githubusercontent.com/fba763c5787a82616ad7ad28107a9f68aaaebfdad9b8102a53a7d7849857396a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f6c696768742d7261696e2e737667)](https://camo.githubusercontent.com/fba763c5787a82616ad7ad28107a9f68aaaebfdad9b8102a53a7d7849857396a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f6c696768742d7261696e2e737667)Clear with heavy rain`clear-heavy-rain-night`️ 🌧[![](https://camo.githubusercontent.com/1226872df2d7968c37f6ad9984febc1d10ecbff42561497bdb636d55c927a98a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d68656176792d7261696e2d6e696768742e737667)](https://camo.githubusercontent.com/1226872df2d7968c37f6ad9984febc1d10ecbff42561497bdb636d55c927a98a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d68656176792d7261696e2d6e696768742e737667)Heavy rain`heavy-rain-night`️ 🌧[![](https://camo.githubusercontent.com/48987ee1c1e11f603bb318bd03db4c3ee527cc6f422986f6c18940c13a0e783a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f68656176792d7261696e2e737667)](https://camo.githubusercontent.com/48987ee1c1e11f603bb318bd03db4c3ee527cc6f422986f6c18940c13a0e783a/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f68656176792d7261696e2e737667)Clear with light sleet`clear-light-sleet-night`️️ 🌨[![](https://camo.githubusercontent.com/bfda9e23e8f5359561885c2867e15d9b1588f80da375a1e34df33caa3c261199/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742d6e696768742e737667)](https://camo.githubusercontent.com/bfda9e23e8f5359561885c2867e15d9b1588f80da375a1e34df33caa3c261199/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742d6e696768742e737667)Light sleet`light-sleet-night`️️ 🌨[![](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)Clear with heavy sleet`clear-heavy-sleet-night`️️ 🌨[![](https://camo.githubusercontent.com/bfda9e23e8f5359561885c2867e15d9b1588f80da375a1e34df33caa3c261199/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742d6e696768742e737667)](https://camo.githubusercontent.com/bfda9e23e8f5359561885c2867e15d9b1588f80da375a1e34df33caa3c261199/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736c6565742d6e696768742e737667)Heavy sleet`heavy-sleet-night`️️ 🌨[![](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)](https://camo.githubusercontent.com/877f96a97ecf9b82253e60bc534066e15dc25a725c9edd92571d0c185d3128ff/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736c6565742e737667)Clear with light snow`clear-light-snow-night`️️ ☃️[![](https://camo.githubusercontent.com/6f227fd1bfed82eff641b9c681032d16bd102631303a0544ba9b872ce1507a70/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772d6e696768742e737667)](https://camo.githubusercontent.com/6f227fd1bfed82eff641b9c681032d16bd102631303a0544ba9b872ce1507a70/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772d6e696768742e737667)Light snow`light-snow-night`️️ ☃️[![](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)Clear with heavy snow`clear-heavy-snow-night`️️ ☃️[![](https://camo.githubusercontent.com/6f227fd1bfed82eff641b9c681032d16bd102631303a0544ba9b872ce1507a70/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772d6e696768742e737667)](https://camo.githubusercontent.com/6f227fd1bfed82eff641b9c681032d16bd102631303a0544ba9b872ce1507a70/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f636c6561722d736e6f772d6e696768742e737667)Heavy snow`heavy-snow-night`️️ ☃️[![](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)](https://camo.githubusercontent.com/a22ee020ad86d2e231ac8ee9642e6b5a5f62ff03330f04380b73c6cb4b3ac6ed/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f736e6f772e737667)Blowing snow`blowing-snow-night`️️ 🌬[![](https://camo.githubusercontent.com/a21822cd14772b9c61fa787577ee1f680816a5033a14649a351b434a8d7c6dc0/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f626c6f77696e672d736e6f772e737667)](https://camo.githubusercontent.com/a21822cd14772b9c61fa787577ee1f680816a5033a14649a351b434a8d7c6dc0/68747470733a2f2f727567616172642e6769746875622e696f2f7061636b616765732f646d692f776561746865722d69636f6e732f626c6f77696e672d736e6f772e737667)🏛 Municipalities
----------------

[](#-municipalities)

Denmark is split into 98 municipalities. In the list below are all the municipalities and their corresponding ID.

NameIDNameIDNameIDNameIDAlbertslund165Allerød201Assens420Ballerup151Billund530Bornholm400Brøndby153Brønderslev810Dragør155Egedal240Esbjerg561Fanø563Favrskov710Faxe320Fredensborg210Fredericia607Frederiksberg147Frederikshavn813Frederikssund250Furesø190Faaborg-Midtfyn430Gentofte157Gladsaxe159Glostrup161Greve253Gribskov270Guldborgsund376Haderslev510Halsnæs260Hedensted766Helsingør217Herlev163Herning657Hillerød219Hjørring860Holbæk316Holstebro661Horsens615Hvidovre167Høje-Taastrup169Hørsholm223Ikast-Brande756Ishøj183Jammerbugt849Kalundborg326Kerteminde440Kolding621København101Køge259Langeland482Lejre350Lemvig665Lolland360Lyngby-Taarbæk173Læsø825Mariagerfjord846Middelfart410Morsø773Norddjurs707Nordfyns480Nyborg450Næstved390Odder727Odense461Odsherred306Randers730Rebild840Ringkøbing-Skjern760Ringsted329Roskilde265Rudersdal230Rødovre175Samsø741Silkeborg740Skanderborg746Skive779Slagelse330Solrød269Sorø340Stevns336Struer671Svendborg479Syddjurs706Sønderborg540Thisted787Tønder550Tårnby185Vallensbæk187Varde573Vejen575Vejle630Vesthimmerland820Viborg791Vordingborg390Ærø492Aabenraa580Aalborg851Aarhus🗣 Frequently Asked Questions (FAQ)
----------------------------------

[](#-frequently-asked-questions-faq)

#### How do I find the ID of a pre-defined location?

[](#how-do-i-find-the-id-of-a-pre-defined-location)

There are two ways to find it:

1. Use this package's [search endpoint](#search-locations).
2. Go to [DMI's website](https://www.dmi.dk/) and use the search feature in the top right corner. If your desired location pops up; click on it and you will be directed to the locations page. You can now copy/paste the ID from the locations URL.

> https://[www.dmi.dk/lokation/show/DK/](http://www.dmi.dk/lokation/show/DK/)**`2618425`**/København/

#### What is this `Tightenco\Collect\Support\Collection` class and how does it work?

[](#what-is-this-tightencocollectsupportcollection-class-and-how-does-it-work)

All endpoints returns data within a `Tightenco\Collect\Support\Collection` class. The class is a port of the popular `Collection` class from [Laravel](https://laravel.com).

Please refer to [Laravel](https://laravel.com)'s detailed documentation, to learn more about how you work with a `Collection`:

🗺 Roadmap
---------

[](#-roadmap)

#### Internal caching

[](#internal-caching)

Some endpoints, like [National forecasts](#national-forecast), [sunrise and sunset](#sun-times) and [pollen measurements](#pollen) are endpoints which doesn't change/update very often.

By implementing some form of internal caching, we could cache these kind of endpoints. This would increase the response time and we would avoid making unnecessary requests to DMI.

🚓 License
---------

[](#-license)

This package is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 (CC BY-NC-ND 4.0)](https://creativecommons.org/licenses/by-nc-nd/4.0/).

[![Creative Commons License](https://camo.githubusercontent.com/226202689215cfe3077946570d1d45b99e1bd507628d1843e9ded32ddc8cc055/68747470733a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792d6e632d6e642f342e302f38387833312e706e67)](https://creativecommons.org/licenses/by-nc-nd/4.0/)

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance69

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~163 days

Recently: every ~449 days

Total

15

Last Release

212d ago

Major Versions

1.1.11 → v2.x-dev2025-10-15

PHP version history (4 changes)1.0.0PHP ^7.2

v1.x-devPHP ^7.2|^8.0

1.1.11PHP ^7.2|^8.0|^8.1|^8.2|^8.3

v2.x-devPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1007ed23e51422c83de722371145b5bfcb0e57199befa00a441f734af903c77?d=identicon)[rugaard](/maintainers/rugaard)

---

Top Contributors

[![rugaard](https://avatars.githubusercontent.com/u/179868?v=4)](https://github.com/rugaard "rugaard (19 commits)")

---

Tags

apidanish-meteorological-institutedanmarks-meteorologiske-institutdmidmi-apiforecastmeteorologyweatherweather-dataapiweatherforecastweather forecastrugaardmortenmorten rugaarddmidanish meteorological institutedmi apidanish meteorological institute api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rugaard-dmi/health.svg)

```
[![Health](https://phpackages.com/badges/rugaard-dmi/health.svg)](https://phpackages.com/packages/rugaard-dmi)
```

###  Alternatives

[rugaard/weatherkit

Integrate Apple WeatherKit API into your project

111.4k](/packages/rugaard-weatherkit)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)[adinan-cenci/climatempo-api

Uma api para previsão de tempo escrita em PHP.

448.2k](/packages/adinan-cenci-climatempo-api)[gnahotelsolutions/laravel-weather

🌤️ A wrapper around Open Weather Map to get the current weather on a location.

385.3k](/packages/gnahotelsolutions-laravel-weather)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
