HAALCENTRAAL BAG Individuele Bevragingen

Getting Started

To connect, you can go through the following steps:

  1. Register to obtain access to the acceptance and production environments
  2. View the functionality and specifications
  3. Implement the API client
  4. Try and test the API

Registering

Request an API key for the test and production environments. Testing is preferably done in the test environment.

Functionality and specifications

You can view the Open API Specifications (OAS3) of the API in Swagger format or Redoc. The (resolved) OAS3 can be downloaded here: openapi.yaml.

Available endpoints

The API has the following endpoints:

The object endpoints supply one or more (occurrences of) objects, with embedded resources and links.

The endpoints Adressen, Adressen uitgebreid and Adresseerbare objecten are composite (convenience) endpoints in which the data of different BAG objects is combined.

Search entries of the various endpoints

Every endpoint has its own set of data and every endpoint can be queried through different search entries. The table Wat zit in welk endpoint shows which search entries are possible for the various endpoints and what information this yields.

General functionality

There are a number of general functions that apply to the requests above:

Use cases worked out

Searching for an address by postal code and house number within the Adressen endpoint

You can search for an address with the endpoint /adressen/. As a search entry, the combination of postal code and house number can be used, for example.

A complete overview of possible search entries is included in the table Wat zit in welk endpoint.

This search function can sometimes yield many search results. That is why paging is applied here.

In the example below, a search was made for postal code 2631 CR, house number 15 and house letter c.

{
  "_links": {
    "self": {
      "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/adressen?postcode=2631CR&huisnummer=15&huisletter=C&page=1&pageSize=20"
    }
  },
  "_embedded": {
    "adressen": [
      {
        "openbareRuimteNaam": "Dorpsstraat",
        "korteNaam": "Dorpsstraat",
        "huisnummer": 15,
        "huisletter": "c",
        "postcode": "2631CR",
        "woonplaatsNaam": "Nootdorp",
        "nummeraanduidingIdentificatie": "1926200000508011",
        "openbareRuimteIdentificatie": "1926300000479027",
        "woonplaatsIdentificatie": "1142",
        "adresseerbaarObjectIdentificatie": "1926010000508012",
        "pandIdentificaties": [
          "1926100000485708"
        ],
        "adresregel5": "Dorpsstraat 15 c",
        "adresregel6": "2631 CR  NOOTDORP",
        "_links": {
          "self": {
            "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/adressen/1926200000508011"
          },
          "openbareRuimte": {
            "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/openbareruimten/1926300000479027"
          },
          "nummeraanduiding": {
            "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/nummeraanduidingen/1926200000508011"
          },
          "woonplaats": {
            "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/woonplaatsen/1142"
          },
          "adresseerbaarObject": {
            "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/verblijfsobjecten/1926010000508012"
          },
          "panden": [
            {
              "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/panden/1926100000485708"
            }
          ]
        }
      }
    ]
  }
}

Searching for all dwellings located within a building

When you are looking for all dwellings located within a building, you can do this by using the verblijfsobjecten endpoint. By using the pandidentificatie as a search entry, all dwellings within the building are supplied.

You do this with /verblijfsobjecten?pandIdentificatie={pandIdentificatie}, where {pandIdentificatie} must be replaced by the identification of the building concerned. For example /adressen?pandIdentificatie=0268100000021458.

As this can yield many addresses, paging is applied here.

https://api.bag.kadaster.nl/lvbag/individuelebevragingen/v2/verblijfsobjecten?pandIdentificatie=0268100000021458

{
  "_embedded": {
    "verblijfsobjecten": [
      {
        "verblijfsobject": {
          "type": "Verblijfsobject",
          "heeftAlsHoofdAdres": "0268200000041560",
          "identificatie": "0268010000036826",
          "domein": "NL.IMBAG.Verblijfsobject",
          "geometrie": {
            "punt": {
              "type": "Point",
              "coordinates": [
                183003.794,
                425425.693,
                0
              ]
            }
          },
          "gebruiksdoelen": [
            "woonfunctie"
          ],
          "oppervlakte": 43,
          "status": "Verblijfsobject in gebruik",
          "geconstateerd": "N",
          "documentdatum": "2021-07-01",
          "documentnummer": "D210972177",
          "voorkomen": {
            "tijdstipRegistratie": "2021-07-01T10:26:36.247",
            "versie": 2,
            "beginGeldigheid": "2021-07-01",
            "tijdstipRegistratieLV": "2021-07-01T10:48:29.003"
          },
          "maaktDeelUitVan": [
            "0268100000021458"
          ],
          "_links": {
            "self": {
              "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/verblijfsobjecten/0268010000036826"
            },
            "heeftAlsHoofdAdres": {
              "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/nummeraanduidingen/0268200000041560"
            },
            "maaktDeelUitVan": [
              {
                "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/panden/0268100000021458"
              }
            ]
          }
        }
      }
    ]
  }
}

Searching for addresses within a bounding box

The BAG API offers the possibility of requesting BAG data within a specific area (bounding box). It is possible, for example, to use a bounding box to search for addressable objects (with address data) within a maximum area of 250,000 square metres.

Within the adresseerbare objecten endpoint, the x and y coordinates of the bottom left corner and the x and y coordinates of the top right corner can be supplied. These two points make a rectangular box within which the search is carried out.

Note that Content-Crs epsg:28992 must be supplied with the query.

The URL is as follows:

https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/adresseerbareobjecten?huidig=false&page=1&pageSize=20&bbox=230781.67,582665.17,230956.35,582882.42
{
  "_embedded": {
    "adresseerbareObjecten": [
      {
        "verblijfsobject": {
          "verblijfsobject": {
            "type": "Verblijfsobject",
            "heeftAlsHoofdAdres": "0014200010900021",
            "identificatie": "0014010011089620",
            "domein": "NL.IMBAG.Verblijfsobject",
            "geometrie": {
              "punt": {
                "type": "Point",
                "coordinates": [
                  230900.789,
                  582669.048,
                  0
                ]
              }
            },
            "gebruiksdoelen": [
              "overige gebruiksfunctie"
            ],
            "oppervlakte": 19,
            "status": "Verblijfsobject in gebruik",
            "geconstateerd": "N",
            "documentdatum": "2013-02-19",
            "documentnummer": "3535704",
            "voorkomen": {
              "tijdstipRegistratie": "2013-02-22T09:17:09",
              "versie": 2,
              "beginGeldigheid": "2013-02-19",
              "tijdstipRegistratieLV": "2013-02-22T09:35:31.531"
            },
            "maaktDeelUitVan": [
              "0014100010923600"
            ],
            "_links": {
              "self": {
                "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/verblijfsobjecten/0014010011089620"
              },
              "heeftAlsHoofdAdres": {
                "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/nummeraanduidingen/0014200010900021"
              },
              "maaktDeelUitVan": [
                {
                  "href": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/panden/0014100010923600"
                }
              ]
            }
          }
        }
      }
    ]
  }
}

Restrictions on the use of the BAG API Individuele Bevragingen

Use of the BAG API Individuele Bevragingen is free of charge. Conditions apply to the use of this service in order to prevent excessive or undesirable use of the API. We want to keep the BAG API fast and usable for all consumers. To be able to guarantee this, limits have been set. More information about the restrictions of the BAG API can be found here.

Implement the API client

Client code can be generated with the “genereervariant” of the API specifications and a code generator. An overview of code generators can be found at OpenAPI.Tools.

Trying and testing the API

The behaviour of the API is easiest to test using Postman. You can import the openapi.yaml as a project, after which the various requests that this API supports are loaded.

API key

To be able to query the API, an API key is needed. You must include this in the request in the request header “X-Api-Key”. Request an API key for the BAG API.

Test cases

The tables below contain test cases for specific situations with which the behaviour of the API can be tested:

ResourceTest situationURI
adressenAddress with a diacritic in the street name, house number, house letter and house number addition/adressen/0484200002040489
adressenLong street name/adressen/0417200000000354
adressenSecondary address/adressen/0014200022197986
adressenEstablished (geconstateerd)/adressen/0014200022188962
adressenSeveral buildings at the same address/adressen/0193200000096680
adresseerbareobjectenDwelling (verblijfsobject)/adresseerbareobjecten/0599010000165822
adresseerbareobjectenStanding place (standplaats)/adresseerbareobjecten/0503030000103062
adresseerbareobjectenBerth (ligplaats)/adresseerbareobjecten/0569020000012435
adresseerbareobjectenSeveral purposes of use/adresseerbareobjecten/0626019900006674
adresseerbareobjectenWith a secondary address/adresseerbareobjecten/0014010011067299
adresseerbareobjectenSeveral buildings/adresseerbareobjecten/0193010000096628
pandenMany addresses/panden/0826100000000467
pandenWith a secondary address/panden/0014100010921152
pandenWithout an address/panden/0503100000034877