PHPackages                             rugaard/pollen - 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/pollen

ActiveLibrary[API Development](/categories/api)

rugaard/pollen
==============

Fetch latest Pollen measurements from Astma-Allergi Denmark.

2.0.0(1mo ago)813MITPHPPHP ^8.3

Since Jul 27Pushed 1mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (12)Versions (9)Used By (0)

[![Food Platform](.github/banner.png)](.github/banner.png)

🇩🇰🤧 Pollen measurements from Astma-Allergi Denmark
==================================================

[](#-pollen-measurements-from-astma-allergi-denmark)

[![](https://camo.githubusercontent.com/72953407a2b2ce2cffae3d5a0fb6b0c564722139263565b48fb7fc9302475e51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f727567616172642f706f6c6c656e2e737667)](https://github.com/rugaard/pollen/releases)[![](https://camo.githubusercontent.com/cfcbaa058880bc251c911bc111f70b161634f10aa1643b817a759ccd7378d8b5/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76312e7376673f6c6162656c436f6c6f723d356635663566266c6162656c3d6c6963656e736526636f6c6f723d343338393761266d6573736167653d434325323042592d4e432d4e44)](https://creativecommons.org/licenses/by-nc-nd/4.0/)

Astma-Allergi Denmark does unfortunately not offer an official API for the latest pollen measurements in Denmark.

This package is (in some form) a workaround for that. It fetches the latest measurements and short-term predictions directly from Astma-Allergi Denmark's data feed and turns it into structured, typed data objects.

The returned data shows the measured pollen between **13:00 (UTC +1)** *(1:00 PM)* yesterday and **13:00 (UTC +1)** *(1:00 PM)* present day. Every day at **16:30 (UTC +1)** *(4:30 PM)*, at the latest, the new measurements are being published.

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

[](#️-disclaimer)

Since Astma-Allergi Denmark is an independent union, with a very little government funding, this package is made available under a very strict license, which prohibits any use other than personal.

If you wish to use the pollen measurements commercially, you should contact Astma-Allergi Denmark directly and support them by buying the data instead. The payment goes directly to the maintenance and further development of their Pollen measurement service.

For more info about a commercial license, [visit their official website](https://hoefeber.astma-allergi.dk/pollenfeed).

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

[](#-table-of-contents)

- [Requirements](#-requirements)
- [Installation](#-installation)
    - [Laravel](#laravel)
- [Usage](#-usage)
    - [Pollen Client](#pollen-client)[![img.png](img.png)](img.png)
    - [Methods](#methods)
        - [Get measurements](#get-measurements)
    - [Return data structure](#return-data-structure)
- [Pollen stations](#-pollen-stations)
- [Allergens](#-allergens)
    - [Icons](#-icons)
- [Level classification](#-level-classification)
- [Frequently Asked Questions (FAQ)](#-frequently-asked-questions-faq)
    - [What is this `Illuminate\Support\Collection` class and how does it work?](#what-is-this-illuminatesupportcollection-class-and-how-does-it-work)
- [Donating to Astma-Allergi Denmark](#-donating-to-astma-allergi-denmark)
- [License](#-license)

🖥 Requirements
--------------

[](#-requirements)

- **PHP 8.3** or higher
- **[GuzzleHTTP](https://github.com/guzzle/guzzle) 7.0** or higher

📦 Installation
--------------

[](#-installation)

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

```
composer require rugaard/pollen
```

### Laravel

[](#laravel)

This package comes with an out-of-the-box Service Provider for the [Laravel](http://laravel.com) framework, which is loaded automatically via package discovery.

⚙️ Usage
--------

[](#️-usage)

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

```
use Rugaard\Pollen\Pollen;

$pollen = new Pollen;
```

Once you've done that, you're ready to fetch the latest measurements.

### Pollen client

[](#pollen-client)

The Pollen client which handles the requests to Astma-Allergi Denmark.

```
new Pollen(?GuzzleClientInterface $client = null);
```

ParameterTypeDefaultDescription`$client``\GuzzleHttp\ClientInterface``null`Replace the default underlying HTTP client### Methods

[](#methods)

#### Get measurements

[](#get-measurements)

Get the latest pollen measurements and predictions. Optionally filter by station and/or exclude allergens that are currently out of season.

```
get(?Station $station = null, bool $onlyInSeason = false): Collection
```

ParameterTypeDefaultDescription`$station``Station|null``null`Filter by a specific [pollen station](#-pollen-stations). Returns all stations when `null`.`$onlyInSeason``bool``false`When `true`, allergens that are currently out of season are excluded from the result.***Note**: The returned data shows the measured pollen between 13:00 (1:00 PM) yesterday and 13:00 (1:00 PM) present day. The measurements are updated everyday at 16:00 (4:00 PM).*

**Examples:**

```
use Rugaard\Pollen\Enums\Station;
use Rugaard\Pollen\Pollen;

$pollen = new Pollen;

# All stations.
$measurements = $pollen->get();

# A specific station.
$measurements = $pollen->get(station: Station::East);

# A specific station, in-season allergens only.
$measurements = $pollen->get(station: Station::East, onlyInSeason: true);
```

### Return data structure

[](#return-data-structure)

#### Single station

[](#single-station)

When a `$station` is provided, `get()` returns a `Collection` keyed by allergen code. Each value is either a `Collection` with measurement data, or `null` if the allergen is currently out of season.

```
$measurements = $pollen->get(station: Station::East);

// Access a specific allergen.
$birch = $measurements->get('birch');

// $birch is a Collection:
// [
//     'date'        => '2024-04-01',        // measurement date
//     'value'       => 200,                 // raw grain count
//     'level'       => Level::High,         // classified level enum
//     'predictions' => Collection [         // null for spore allergens
//         ['date' => '2024-04-02', 'level' => Level::Moderate],
//         ['date' => '2024-04-03', 'level' => Level::Low],
//     ],
// ]

// Out-of-season allergens are null.
$mugwort = $measurements->get('mugwort'); // null
```

#### All stations

[](#all-stations)

When no `$station` is provided, `get()` returns a `Collection` keyed by station value (`'east'`, `'west'`), where each entry contains the station's allergen measurements as described above.

```
$measurements = $pollen->get();

$east = $measurements->get('east'); // Collection of allergens for Station::East
$west = $measurements->get('west'); // Collection of allergens for Station::West
```

🏛 Pollen stations
-----------------

[](#-pollen-stations)

Currently there only exist two pollen stations in Denmark.

EnumIDNameCodeRegion`Station::East`48København`east`East`Station::West`49Viborg`west`West🌿 Allergens
-----------

[](#-allergens)

The following allergens are supported. Spore allergens do not have predictions.

EnumCodeDanish nameType`Allergen::Alder``alder`ElPollen`Allergen::Hazel``hazel`HasselPollen`Allergen::Elm``elm`ElmPollen`Allergen::Birch``birch`BirkPollen`Allergen::Grass``grass`GræsPollen`Allergen::Mugwort``mugwort`BynkePollen`Allergen::Alternaria``alternaria`AlternariaSpore`Allergen::Cladosporium``cladosporium`CladosporiumSpore### 🖼 Icons

[](#-icons)

The `assets/` folder contains a PNG icon for each allergen, named after its code.

IconAllergen[![](assets/alder.png)](assets/alder.png)`alder`[![](assets/hazel.png)](assets/hazel.png)`hazel`[![](assets/elm.png)](assets/elm.png)`elm`[![](assets/birch.png)](assets/birch.png)`birch`[![](assets/grass.png)](assets/grass.png)`grass`[![](assets/mugwort.png)](assets/mugwort.png)`mugwort`[![](assets/alternaria.png)](assets/alternaria.png)`alternaria`[![](assets/cladosporium.png)](assets/cladosporium.png)`cladosporium`📊 Level classification
----------------------

[](#-level-classification)

Each allergen measurement is classified into one of five levels, represented by the `Level` enum. Thresholds vary per allergen.

EnumCodeDanish nameDescription`Level::Unknown``unknown`ukendtNo measurable pollen (count = 0)`Level::Low``low`lavtBelow the low threshold`Level::Moderate``moderate`moderatBelow the moderate threshold`Level::High``high`højtBelow the high threshold`Level::VeryHigh``very-high`meget højtAt or above the high threshold```
use Rugaard\Pollen\Enums\Level;

$birch = $measurements->get('birch');

// Compare against a level.
if ($birch->get('level') === Level::VeryHigh) {
    // 🤧
}

// Get a machine-readable code.
$birch->get('level')->code(); // e.g. 'very-high'

// Get the Danish name.
$birch->get('level')->danishName(); // e.g. 'meget højt'
```

🗣 Frequently Asked Questions (FAQ)
----------------------------------

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

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

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

All data is returned within an `Illuminate\Support\Collection`. This is the same `Collection` class used by the [Laravel](https://laravel.com) framework, available as a standalone package — so no Laravel installation is required.

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

💰 Donating to Astma-Allergi Denmark
-----------------------------------

[](#-donating-to-astma-allergi-denmark)

To help Astma-Allergi Denmark maintain and further develop the Pollen measurement service.
Please consider [sending them a donation](https://www.astma-allergi.dk/stot-os/giv-et-bidrag/).

🚓 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

51

—

FairBetter than 95% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity79

Established project with proven stability

 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 ~497 days

Recently: every ~622 days

Total

6

Last Release

45d ago

Major Versions

1.0.3 → 2.0.02026-05-17

PHP version history (3 changes)1.0.0PHP ^7.2

1.0.3PHP ^7.2|^8.0

2.0.0PHP ^8.3

### 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 (9 commits)")

---

Tags

allergyapiasthmaastma-allergiastma-allergi-danmarkastma-allergi-denmarkmeasurementspollenpollen-measurementsmeasurementsrugaardmortenmorten rugaardpollenpollen measurementshay feverallergic hay feverasthmaallergies

###  Code Quality

TestsPest

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[illuminate/http

The Illuminate Http package.

11937.9M6.7k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[illuminate/mail

The Illuminate Mail package.

5910.6M485](/packages/illuminate-mail)

PHPackages © 2026

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