PHPackages                             label84/laravel-nederland-postcode - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. label84/laravel-nederland-postcode

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

label84/laravel-nederland-postcode
==================================

Integrate Dutch address validations into your Laravel application using the Nederland Postcode API.

1.3.2(1mo ago)4207MITPHPCI passing

Since Dec 8Pushed 1mo agoCompare

[ Source](https://github.com/Label84/laravel-nederland-postcode)[ Packagist](https://packagist.org/packages/label84/laravel-nederland-postcode)[ RSS](/packages/label84-laravel-nederland-postcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (9)Used By (0)

Nederland Postcode Laravel
==========================

[](#nederland-postcode-laravel)

[![Nederland Postcode API](./docs/nederlandpostcodeapi.png)](./docs/nederlandpostcodeapi.png)

Nederland Postcode Laravel makes it easy to integrate Dutch address validation and energy label lookups into your Laravel application using the [Nederland Postcode API](https://nederlandpostcode.nl).

**Key features:**

- Validate and retrieve Dutch addresses by postcode and house number
- Retrieve coordinates (latitude and longitude) for addresses
- Fetch energy labels (energielabel) for residential and commercial buildings
- Check your API usage quota

This package is a Laravel wrapper for [Nederland Postcode PHP](https://github.com/Label84/php-nederland-postcode).

Register for free at [nederlandpostcode.nl](https://nederlandpostcode.nl) to obtain your **test API key**.

Table of Contents
-----------------

[](#table-of-contents)

- [Laravel Support](#laravel-support)
- [Installation](#installation)
- [Usage](#usage)
    - [Address Endpoint](#address-endpoint)
        - [Single Address](#single-address)
        - [Multiple Addresses](#multiple-addresses)
    - [Energy Label Endpoint](#energy-label-endpoint)
    - [Quota Endpoint](#quota-endpoint)
- [Error Handling](#error-handling)

Laravel Support
---------------

[](#laravel-support)

VersionRelease13.x^1.312.x^1.3Installation
------------

[](#installation)

Install the package via Composer:

```
composer require label84/laravel-nederland-postcode
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Label84\NederlandPostcode\Laravel\NederlandPostcodeServiceProvider" --tag="config"
```

Add your API key to your `.env` file:

```
NEDERLAND_POSTCODE_API_KEY="your_api_key_here"
```

Usage
-----

[](#usage)

### Address Endpoint

[](#address-endpoint)

The address endpoint allows you to fetch address information from the Nederland Postcode API.

You can search addresses using either the `find` method for a single address or the `list` method for multiple addresses. The `find` method will throw an exception if no address is found or if multiple addresses are found for the given postcode and house number (ie. when the house number has multiple additions like A, B, C, etc.).

The following optional attributes can be requested to be included in the response:

- `coordinates`: Includes latitude and longitude of the address.
- `district`: Includes the official and name of the district that the address belongs to.
- `function`: Includes the function of the address (e.g. residential, commercial, healthcare, etc.).
- `location_status`: Includes the location status of the address (e.g. active, in development, etc.).
- `property_status`: Includes the property status of the address (e.g. in use, under construction, etc.).
- `surface_area`: Includes the surface area of the property in square meters.
- `construction_year`: Includes the construction year of the property.

#### Single Address

[](#single-address)

To fetch a single address for a given postcode and house number, you can use the `find` method.

The `postcode` and `number` parameters are required. The `addition` parameter is optional.

```
use Label84\NederlandPostcode\Laravel\Facades\NederlandPostcode;

$address = NederlandPostcode::find(
        postcode: '1118BN',
        number: 800,
        addition: null,
        attributes: [
            AddressAttributesEnum::COORDINATES,
        ]
    );
```

This will return an `Address` object like this:

```
Address {
    postcode: "1118BN",
    number: 800,
    addition: null,
    street: "Schiphol Boulevard",
    city: "Schiphol",
    municipality: "Haarlemmermeer",
    province: "Noord-Holland",
    coordinates: Coordinates {
        latitude: 52.30528553688755,
        longitude: 4.750645160863609
    },
    district: District {
        official: "Schiphol",
        name: "Schiphol"
    },
    function: "kantoorfunctie",
    location_status: "verblijfsobject in gebruik",
    property_status: "pand in gebruik",
    surface_area: 10398.0,
    construction_year: 2019
}
```

When no address is found for the given postcode and number, an `AddressNotFoundException` is thrown. If multiple addresses are found, a `MultipleAddressesFoundException` is thrown.

#### Multiple Addresses

[](#multiple-addresses)

To fetch multiple addresses for a given postcode and house number, you can use the `list` method.

The `postcode` and `number` parameters are required. The `addition` parameter is optional.

```
use Label84\NederlandPostcode\Laravel\Facades\NederlandPostcode;

$addresses = NederlandPostcode::list(
        postcode: '1015CN',
        number: 10,
        addition: null,
        attributes: [
            'coordinates',
        ]
    );
```

This will return an `AddressCollection` object like this:

```
AddressCollection {
    items: [
        Address {
            postcode: "1015CN",
            number: 10,
            addition: 'A',
            street: "Keizersgracht",
            city: "Amsterdam",
            municipality: "Amsterdam",
            province: "Noord-Holland",
            coordinates: Coordinates {
                latitude: 52.379401496779124,
                longitude: 4.889216673725493
            },
            ...
        },
        Address {
            postcode: "1015CN",
            number: 10,
            addition: 'B',
            street: "Keizersgracht",
            city: "Amsterdam",
            municipality: "Amsterdam",
            province: "Noord-Holland",
            coordinates: Coordinates {
                latitude: 52.379401496779124,
                longitude: 4.889216673725493
            },
            ...
        }, {
            ...
        },
        ...
    ]
}
```

### Energy Label Endpoint

[](#energy-label-endpoint)

The energy label endpoint allows you to fetch energy label information for a given postcode and house number (with optional addition).

```
use Label84\NederlandPostcode\Laravel\Facades\NederlandPostcode;

$energyLabels = NederlandPostcode::energyLabels()->get(
    postcode: '1118BN',
    number: 800,
    addition: null,
);
```

This will return an `EnergyLabelCollection` object like this:

```
EnergyLabelCollection {
    items: [
        EnergyLabel {
            postcode: "1118BN",
            number: 800,
            addition: null,
            street: "Schiphol Boulevard",
            city: "Schiphol",
            inspectionDate: DateTime("2022-08-02"),
            validUntilDate: DateTime("2032-08-02"),
            constructionType: "utiliteitsbouw",
            buildingType: null,
            energyLabel: "A+++",
            maxEnergyDemand: 98.4,
            maxFossilEnergyDemand: 55.48,
            minRenewableShare: 55.3
        }, {
            ...
        }
    ]
}
```

### Quota Endpoint

[](#quota-endpoint)

The quota endpoint allows you to check your current API usage and limits. This endpoint does not increase your usage quota.

Note

Values may lag behind the actual usage. They're cached for up to five minutes, so the `used` and `limit` numbers might not be fully up-to-date.

```
use Label84\NederlandPostcode\Laravel\Facades\NederlandPostcode;

$quota = NederlandPostcode::usage();
```

This will return an `Quota` object like this:

```
Quota {
    used: 1500,
    limit: 10000,
}
```

Error Handling
--------------

[](#error-handling)

The package throws a `NederlandPostcodeException` for any errors encountered during the API request. You can catch this exception to handle errors gracefully:

```
use Label84\NederlandPostcode\Exceptions\NederlandPostcodeException;

try {
    $addresses = NederlandPostcode::find(
        postcode: 'INVALID',
        number: 123,
        addition: null,
    );
} catch (NederlandPostcodeException $exception) {
    // handle error
}
```

When calling the `find` method, if no address is found, an `AddressNotFoundException` is thrown. If multiple addresses are found, a `MultipleAddressesFoundException` is thrown.

When a network or HTTP error occurs during the API request, a `NederlandPostcodeRequestException` is thrown, which wraps the original `RequestException`.

Contributing
------------

[](#contributing)

```
./vendor/bin/phpstan analyse
```

```
./vendor/bin/pint
```

```
./vendor/bin/phpunit
```

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Recently: every ~24 days

Total

7

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78c37d1496f19445af6a812d2275c34bbd08dead68aebae70229d7ff0670ed85?d=identicon)[tjardo](/maintainers/tjardo)

---

Top Contributors

[![tjardoo](https://avatars.githubusercontent.com/u/31533540?v=4)](https://github.com/tjardoo "tjardoo (23 commits)")

---

Tags

laravellaravel-package

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/label84-laravel-nederland-postcode/health.svg)

```
[![Health](https://phpackages.com/badges/label84-laravel-nederland-postcode/health.svg)](https://phpackages.com/packages/label84-laravel-nederland-postcode)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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