PHPackages                             ecodenl/lvbag-php-wrapper - 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. ecodenl/lvbag-php-wrapper

ActiveLibrary

ecodenl/lvbag-php-wrapper
=========================

PHP Wrapper for the LVBAG API

v2.1.2(11mo ago)111.1k↓33.3%OSL-3.0PHPPHP ^8.2CI passing

Since Nov 10Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/Ecodenl/lvbag-php-wrapper)[ Packagist](https://packagist.org/packages/ecodenl/lvbag-php-wrapper)[ RSS](/packages/ecodenl-lvbag-php-wrapper/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (9)Used By (0)

LVBAG PHP Api Wrapper
=====================

[](#lvbag-php-api-wrapper)

A simple PHP wrapper for IMBAG API (LVBAG)

Version Information
-------------------

[](#version-information)

To keep versioning simple, the package version is aligned with the LV BAG API version.

Package versionAPI VersionStatusPHP Version2.1.x2.x.xActive support 🚀^8.22.0.x2.x.xNo active support ❌^7.4.0 | ^8.0Installing
----------

[](#installing)

```
composer require ecodenl/lvbag-php-wrapper

```

---

Using the API
=============

[](#using-the-api)

Read the official API docs
--------------------------

[](#read-the-official-api-docs)

To get a basic understanding of what is possible and what isn't, you should read [the official api docs](https://lvbag.github.io/BAG-API/Technische%20specificatie/).

Setting up the connection
-------------------------

[](#setting-up-the-connection)

```
use Ecodenl\LvbagPhpWrapper\Client;
use Ecodenl\LvbagPhpWrapper\Lvbag;
use Ecodenl\LvbagPhpWrapper\Resources\AdresUitgebreid;

$secret = 'asecretcodeyouneedtoobtain';
// crs is not static, you should change it accordingly to the desired call.
$acceptCRS = 'epsg:28992';

// Establish the connection
$client = Client::init($secret, $acceptCRS);

// Using the production environment endpoint
$shouldUseProductionEndpoint = true;
$client = Client::init($secret, $acceptCRS, $shouldUseProductionEndpoint);

// To get extensive logging from each request
// the client accepts any logger that follows the (PSR-3 standard)[https://github.com/php-fig/log]
// This example uses the logger from laravel, but feel free to pass any logger that implements the \Psr\Log\LoggerInterface
$logger = \Illuminate\Support\Facades\Log::getLogger();
$client = Client::init($secret, $acceptCRS, $shouldUseProductionEndpoint, $logger);

$lvbag = Lvbag::init($client);
```

Resources
---------

[](#resources)

### Adres uitgebreid

[](#adres-uitgebreid)

[Documentation](https://lvbag.github.io/BAG-API/Technische%20specificatie/#/Adres%20uitgebreid).
Based on given address data.

```
// Get all available addresses from te given data
$addresses = $lvbag->adresUitgebreid()
  ->list([
    'postcode' => '3255MC',
    'huisnummer' => 13,
  ]);

// Only return the exact match
$address = $lvbag->adresUitgebreid()
  ->list([
    'postcode' => '3255MC',
    'huisnummer' => 13,
    'exacteMatch' => true
  ]);

// Only return the exact match
$address = $lvbag->adresUitgebreid()
  ->list([
    'postcode' => '3255MC',
    'huisnummer' => 13,
    'huisletter' => 'd',
    'exacteMatch' => true,
  ]);
```

The nummeraanduidingIdentificatie will be returned from the `->list()` call, this call can be useful when you need to get the properties again (for whatever reason).

```
$lvbag->adresUitgebreid()->show('1924200000030235');
```

### Pagination

[](#pagination)

Every list method will return a paginated response:

```
// return page 2
$addresses = $lvbag->adresUitgebreid()
   ->page(2)
   ->list([
      'postcode' => '3255MC',
      'huisnummer' => 13,
   ]);

// Its also possible to change the amount per page.
$addresses = $lvbag->adresUitgebreid()
   ->pageSize(12)
   ->page(2)
   ->list([
      'postcode' => '3255MC',
      'huisnummer' => 13,
   ]);
```

### Woonplaats

[](#woonplaats)

[Documentation](https://lvbag.github.io/BAG-API/Technische%20specificatie/#/Woonplaats).
When calling to `adresUitgebreid()`, an address will contain a `woonplaatsIdentificatie`. This identification can be used to retrieve info about the city of an address:

```
$woonplaatsIdentification = '2134';
$woonplaats = $lvbag->woonplaats()->show($woonplaatsIdentification);

// Pass attributes as second parameter to retrieve more info
$woonplaats = $lvbag->woonplaats()->show($woonplaatsIdentification, [
    // Supports "bronhouders", "geometrie" or "true" (STRING!). "true" returns both.
    'expand' => 'bronhouders',
]);

// This way one can retrieve the municipality of a city.
$woonplaats['_embedded']['bronhouders']
```

In the case one doesn't know the identification, you can still call the list with attributes (pagination applies):

```
$woonplaatsen = $lvbag->woonplaats()->list([
    'naam' => 'Oude-tonge',
    'expand' => 'bronhouders',
]);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance50

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~155 days

Recently: every ~232 days

Total

7

Last Release

356d ago

PHP version history (3 changes)v2.0.0PHP ^7.2.5|^8.0

v2.0.1PHP ^7.4.0|^8.0

v2.1.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ae5357d893c402ae052f7e1705f6071de01dfa303800e6f9ba3ef27188fbea8?d=identicon)[pvankouteren](/maintainers/pvankouteren)

---

Top Contributors

[![frogeyedman](https://avatars.githubusercontent.com/u/26088905?v=4)](https://github.com/frogeyedman "frogeyedman (33 commits)")[![Yinci](https://avatars.githubusercontent.com/u/53834992?v=4)](https://github.com/Yinci "Yinci (9 commits)")[![pvankouteren](https://avatars.githubusercontent.com/u/1055598?v=4)](https://github.com/pvankouteren "pvankouteren (2 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecodenl-lvbag-php-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/ecodenl-lvbag-php-wrapper/health.svg)](https://phpackages.com/packages/ecodenl-lvbag-php-wrapper)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

714214.9k8](/packages/nutgram-nutgram)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)

PHPackages © 2026

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