VKBO (Belgium, Flanders)

reference Facts, options, APIs

On this page

This example looks up an organization’s Belgian enterprise number (ondernemingsnummer / numéro d’entreprise) in the VKBO (Verrijkte KruispuntBank Ondernemingen), the Flemish Government’s copy of the national Crossroads Bank for Enterprises (KBO/BCE), by using the VKBO OGC API Features service of Digitaal Vlaanderen. For each golden record it stores the registered name, commercial name, legal form, legal situation, start date, registered address and its coordinates, contact details, main NACE-BEL activities, employee class, and a link to the annual accounts. No API key is needed.

Flanders only. The VKBO contains only active legal entities with an address in Flanders (the Flemish Region), as described in its dataset record. Enterprises with their address in Brussels or Wallonia are missing (for example Proximus, 0202239951, in Brussels, gets no result), as are natural persons (sole traders) and stopped enterprises. For all Belgian enterprises, the national KBO offers only SOAP web services with certificates and bulk open-data files, which this sample doesn’t use.

Enricher version: V2
API key: not needed

To set up the enricher, see Add REST API enricher, then use the settings and script on this page.

Settings

  • Accepted Business Domain – /Organization, or the business domain that holds your companies.

  • Version – V2 (recommended).

  • API Key – leave empty.

  • Filters – we recommend a rule that only accepts golden records where organization.enterpriseNumber has a value, and, if your data has it, where the address is in Flanders. Otherwise, every record without a Flemish enterprise is listed on the enricher’s Logs tab as having returned no results.

Vocabulary and Properties

organization.enterpriseNumber

organization.enterpriseNumber holds the 10-digit enterprise number, with or without dots and the BE prefix (for example 0400.378.485 or BE0400378485). If your data uses another vocabulary key, change this field and the ENTERPRISE_NUMBER_KEY value at the top of the script.

Request and response

Base URL: https://geo.api.vlaanderen.be/VKBO/ogc/features/v1
Endpoint: GET /collections/Vkbo/items?f=application/geo+json&limit=5&filter-lang=cql-text&filter=Ondernemingsnr='{enterpriseNumber}'
Authentication: none
Rate limits: none published. Each request takes about 1 second.

The script filters the collection with a CQL filter on Ondernemingsnr:

GET https://geo.api.vlaanderen.be/VKBO/ogc/features/v1/collections/Vkbo/items?f=application%2Fgeo%2Bjson&limit=5&filter-lang=cql-text&filter=Ondernemingsnr%3D%270400378485%27
Accept: application/geo+json

The service ignores query parameters it doesn’t know. A plain ?Ondernemingsnr=0400378485 is not a filter: it returns the first rows of the whole collection (up to 10,000 rows of other enterprises). That’s why the script always uses the CQL filter, always sets a small limit, and only accepts a row whose Ondernemingsnr is the number it looked up.

Shortened response (from a real response):

{
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "geometry": { "type": "Point", "coordinates": [4.2210509, 50.7298409] },
    "properties": {
      "Ondernemingsnr": "0400378485",
      "Maatschappelijke_naam": "Colruyt Group",
      "Commerciele_naam": " ",
      "Startdatum": "1950-03-09T00:00:00Z",
      "Datum_stopzetting": "1900-01-01T00:00:00Z",
      "Type_onderneming": "Rechtspersoon",
      "Rechtsvorm": "Naamloze vennootschap",
      "Rechtstoestand": "Normale toestand",
      "KBO_Straat": "Edingensesteenweg",
      "KBO_Huisnr": "196",
      "KBO_Busnr": null,
      "KBO_NISCODE": "23027",
      "KBO_Postcode": "1500",
      "KBO_Gemeente": "Halle",
      "Telefoonnummer": " ",
      "Email": " ",
      "NACE_hoofdact_BTW": "47110",
      "NACE_versie_BTW": "2025",
      "Omschrijving_hoofdact_BTW": "Niet-gespecialiseerde detailhandel waarbij voedings- en genotmiddelen overheersen",
      "NACE_hoofdact_RSZ": "70100",
      "Omschrijving_hoofdact_RSZ": "Activiteiten van hoofdkantoren",
      "Personeelsklasse": "1000 en meer",
      "JAARREK_URL_NBB": "https://consult.cbso.nbb.be/consult-enterprise/0400378485"
    }
  }],
  "numberReturned": 1
}

An enterprise that isn’t in the VKBO returns HTTP 200 with an empty features list.

Properties added by the enricher

Property Response field Example
vkbo.enterpriseNumber Ondernemingsnr 0400378485
vkbo.name Maatschappelijke_naam Colruyt Group
vkbo.commercialName Commerciele_naam Colruyt
vkbo.abbreviation Afgekorte_naam CG
vkbo.enterpriseType Type_onderneming Rechtspersoon
vkbo.legalForm Rechtsvorm Naamloze vennootschap
vkbo.legalSituation Rechtstoestand Normale toestand
vkbo.startDate Startdatum, as YYYY-MM-DD 1950-03-09
vkbo.address KBO_Straat, KBO_Huisnr, KBO_Busnr, KBO_Postcode and KBO_Gemeente, on one line Edingensesteenweg 196, 1500 Halle
vkbo.postalCode KBO_Postcode 1500
vkbo.municipality KBO_Gemeente Halle
vkbo.nisCode KBO_NISCODE 23027
vkbo.latitude second coordinate of the point geometry (WGS 84) 50.7298409
vkbo.longitude first coordinate of the point geometry (WGS 84) 4.2210509
vkbo.phone Telefoonnummer +32 2 000 00 00
vkbo.email Email info@avh.be
vkbo.mainActivityCode NACE_hoofdact_BTW (main activity for VAT) 47110
vkbo.mainActivity Omschrijving_hoofdact_BTW (in Dutch) Niet-gespecialiseerde detailhandel waarbij voedings- en genotmiddelen overheersen
vkbo.naceVersion NACE_versie_BTW 2025
vkbo.employerActivityCode NACE_hoofdact_RSZ (main activity for social security) 70100
vkbo.employerActivity Omschrijving_hoofdact_RSZ (in Dutch) Activiteiten van hoofdkantoren
vkbo.employeeClass Personeelsklasse 1000 en meer
vkbo.annualAccountsUrl JAARREK_URL_NBB https://consult.cbso.nbb.be/consult-enterprise/0400378485

A property is added only when the VKBO returns a value for it; the VKBO uses a single space for an empty text, and 1900-01-01 and 9999-12-31 for an empty date, and these are left out. The commercialName, abbreviation and phone examples are illustrative; the email example is from Ackermans & van Haaren’s record, and the others are from Colruyt Group’s.

If the enricher has a Preview tab, the results appear there first. To add them to golden records, go to the Map tab, select Map Data, and choose Auto Mapping. Select the business domain, enter a new vocabulary named VKBO with the key prefix vkbo, and then create the mapping. Auto mapping also uses name as the golden record name, so remove that from the mapping if you want to keep your existing names. Then process the data on the Process tab. If the enricher has no Preview tab, the properties are added to the golden record as soon as it is enriched.

How the script handles input and errors

  • A leading BE, spaces, dots and dashes are removed, so BE 0400.378.485 is looked up as 0400378485. An old 9-digit number gets a leading 0. Golden records without a valid enterprise number (10 digits starting with 0 or 1, whose last two digits are 97 minus the first eight digits modulo 97) are skipped without calling the API. Establishment unit numbers (starting with 2 to 8) are not looked up.

  • If the enterprise isn’t in the VKBO (no matching row, for example because it is in Brussels or Wallonia), the script logs it and adds nothing. Rows for other numbers are ignored, so an unfiltered answer never adds another enterprise’s data.

  • If the API returns an error (for example HTTP 400 for an invalid filter), the script logs the reason and adds nothing.

  • If the API reports that it is too busy (HTTP 429), the script throws an error that makes the enricher try the golden record again later.

  • Successful results are cached for 24 hours per enterprise number. Not-found answers and errors aren’t cached. To change this, edit CACHE_MILLISECONDS in the script.

Testing the enricher

  • Test connection checks only that the script runs. It doesn’t call the API.

  • To try the setup, create a golden record with organization.enterpriseNumber set to 0400378485 (Colruyt Group, Halle) or 0404616494 (Ackermans & van Haaren, Antwerp).

Limitations

  • Only active legal entities with an address in Flanders are included. Enterprises in Brussels or Wallonia, sole traders, and stopped or struck-off enterprises get no result. Use an enricher filter on the address (for example, Flemish postal codes) to avoid sending records that can’t be found.

  • The VKBO is a copy of the KBO, so changes can reach it later than they reach the KBO.

  • Activity descriptions and legal forms are in Dutch.

  • Establishment units (vestigingseenheden) aren’t added. They are in the same collection, with their own numbers and Ondernemingsnr_maatsch_zetel set to the enterprise number.

  • The data is public KBO data enriched with addresses from the Flemish address register. The dataset record asks for this attribution: “publieke KBO gegevens, verrijkt met adressen uit het Vlaamse Adressenregister”.

Process script

// REST API enricher (V2) - Belgian (Flemish) company lookup in the VKBO
//
// Looks up a golden record's Belgian enterprise number (ondernemingsnummer / numéro
// d'entreprise) in the VKBO (Verrijkte KruispuntBank Ondernemingen), the Flemish Government's
// copy of the national Crossroads Bank for Enterprises (KBO/BCE), using its OGC API Features
// service (https://geo.api.vlaanderen.be/VKBO/ogc/features), and adds the result to the golden
// record as vkbo.* properties:
//
//   vkbo.enterpriseNumber      10-digit enterprise number that was looked up
//   vkbo.name                  registered name (maatschappelijke naam)
//   vkbo.commercialName        commercial name
//   vkbo.abbreviation          abbreviated name
//   vkbo.enterpriseType        type of enterprise, for example Rechtspersoon
//   vkbo.legalForm             legal form, for example Naamloze vennootschap
//   vkbo.legalSituation        legal situation, for example Normale toestand
//   vkbo.startDate             start date of the enterprise (YYYY-MM-DD)
//   vkbo.address               registered address on one line
//   vkbo.postalCode            postal code of the registered address
//   vkbo.municipality          municipality of the registered address
//   vkbo.nisCode               NIS code of the municipality
//   vkbo.latitude              latitude of the address (WGS 84)
//   vkbo.longitude             longitude of the address (WGS 84)
//   vkbo.phone                 phone number
//   vkbo.email                 email address
//   vkbo.mainActivityCode      main activity (NACE-BEL) for VAT purposes, for example 47110
//   vkbo.mainActivity          description of that activity (Dutch)
//   vkbo.naceVersion           NACE-BEL version of that code, for example 2025
//   vkbo.employerActivityCode  main activity (NACE-BEL) for social security (RSZ) purposes
//   vkbo.employerActivity      description of that activity (Dutch)
//   vkbo.employeeClass         number-of-employees class, for example 20 tot 49
//   vkbo.annualAccountsUrl     link to the enterprise's annual accounts at the National Bank of Belgium
//
// The VKBO only contains active legal entities with an address in Flanders (the Flemish
// Region). Enterprises in Brussels or Wallonia, natural persons (sole traders) and stopped
// enterprises get no result.
//
// No API key is needed. See README.md next to this file for the enricher settings.
//
// A record gets no result (nothing is stored) when it has no valid enterprise number, when the
// enterprise isn't in the VKBO, or when the API can't answer.

// ---- Settings -------------------------------------------------------------------------

// Vocabulary key to read. Add the same key to the Vocabulary and Properties field.
const ENTERPRISE_NUMBER_KEY = "organization.enterpriseNumber";

const VKBO_URL = "https://geo.api.vlaanderen.be/VKBO/ogc/features/v1/collections/Vkbo/items";

// How long to reuse an answer for the same enterprise number. 0 turns caching off.
const CACHE_MILLISECONDS = 24 * 60 * 60 * 1000;

// ---- Script ---------------------------------------------------------------------------

// The service ignores parameters it doesn't know and then returns unfiltered rows, so the
// query always uses the CQL filter and a small limit, and the script only accepts a row whose
// enterprise number matches.
const MAX_ROWS = 5;

function getValue(key) {
  // A plain loop rather than vocabularies.find(...): vocabularies is a .NET list, and when
  // .find is called from inside a function, later calls return the first call's match.
  const items = vocabularies || [];
  for (let i = 0; i < items.length; i++) {
    if (items[i].Key === key) {
      const value = items[i].Value;
      return value === null || value === undefined ? "" : String(value).trim();
    }
  }
  return "";
}

// Accepts "0400378485", "0400.378.485", "BE 0400 378 485", "BE0400378485" and the old 9-digit
// form "400378485". Returns the 10 digits, or null when it isn't a valid enterprise number
// (starts with 0 or 1; the last two digits are 97 minus the first eight modulo 97).
function parseEnterpriseNumber(raw) {
  let digits = raw.toUpperCase().replace(/^BE/, "").replace(/[\s.\-\/]/g, "");
  if (/^\d{9}$/.test(digits)) {
    digits = "0" + digits;
  }
  if (!/^[01]\d{9}$/.test(digits)) {
    return null;
  }
  const check = 97 - (Number(digits.substring(0, 8)) % 97);
  return check === Number(digits.substring(8)) ? digits : null;
}

function clean(value) {
  if (value === null || value === undefined) {
    return null;
  }
  const text = String(value).replace(/\s+/g, " ").trim();
  return text === "" ? null : text;
}

function parseJson(text) {
  try {
    return JSON.parse(text);
  } catch (e) {
    return null;
  }
}

// VKBO dates are timestamps such as "1950-03-09T00:00:00Z"; 1900-01-01 and 9999-12-31 mean "none".
function dateOnly(value) {
  const text = clean(value);
  if (!text || !/^\d{4}-\d{2}-\d{2}/.test(text)) {
    return null;
  }
  const date = text.substring(0, 10);
  return date === "1900-01-01" || date === "9999-12-31" ? null : date;
}

function formatAddress(p) {
  const street = [clean(p.KBO_Straat), clean(p.KBO_Huisnr)].filter((x) => !!x).join(" ");
  const box = clean(p.KBO_Busnr);
  const line1 = street && box ? `${street} bus ${box}` : street;
  const line2 = [clean(p.KBO_Postcode), clean(p.KBO_Gemeente)].filter((x) => !!x).join(" ");
  const parts = [line1, line2].filter((x) => !!x);
  return parts.length > 0 ? parts.join(", ") : null;
}

function coordinate(geometry, index) {
  const coordinates = geometry && geometry.type === "Point" && Array.isArray(geometry.coordinates) ? geometry.coordinates : null;
  return coordinates && typeof coordinates[index] === "number" ? coordinates[index] : null;
}

// Calls the API. Returns the matching feature, or null when there's no answer to store.
function lookUp(enterpriseNumber) {
  const filter = stringEncoder.urlEncode(`Ondernemingsnr='${enterpriseNumber}'`);
  const apiResponse = http.send({
    url: `${VKBO_URL}?f=application%2Fgeo%2Bjson&limit=${MAX_ROWS}&filter-lang=cql-text&filter=${filter}`,
    method: "GET",
    headers: [{ Key: "Accept", Value: "application/geo+json" }],
  });

  const status = String(apiResponse.HttpStatus || "");
  const body = parseJson(apiResponse.Content);

  if (status === "TooManyRequests") {
    throw new Error("TooManyRequests - the VKBO service is busy, the record will be retried");
  }

  if (status === "OK" && body && Array.isArray(body.features)) {
    // Establishment units (vestigingseenheden) are in the same collection with their own
    // numbers, so only the enterprise itself matches.
    const features = body.features;
    for (let i = 0; i < features.length && i < MAX_ROWS; i++) {
      const p = features[i] && features[i].properties;
      if (p && clean(p.Ondernemingsnr) === enterpriseNumber && clean(p.Maatschappelijke_naam)) {
        return features[i];
      }
    }
    log(`The VKBO has no enterprise ${enterpriseNumber}. Only active legal entities with an address in Flanders are included.`);
    return null;
  }

  log(`The VKBO could not look up ${enterpriseNumber}. HTTP ${status}. ${String(apiResponse.Content || "").substring(0, 200)}`);
  return null;
}

function run() {
  const enterpriseNumber = parseEnterpriseNumber(getValue(ENTERPRISE_NUMBER_KEY));
  if (!enterpriseNumber) {
    // No valid enterprise number on this record (this is also what Test connection hits,
    // because it passes placeholder values instead of real ones).
    return [];
  }

  const cacheKey = `vkbo:${enterpriseNumber}`;
  const cached = CACHE_MILLISECONDS > 0 ? cache.get(cacheKey) : null;
  let feature = cached ? parseJson(String(cached)) : null;

  if (!feature) {
    feature = lookUp(enterpriseNumber);
    if (!feature) {
      return [];
    }
    if (CACHE_MILLISECONDS > 0) {
      cache.set(cacheKey, JSON.stringify(feature), CACHE_MILLISECONDS);
    }
  }

  const p = feature.properties || {};

  const data = {
    "vkbo.enterpriseNumber": enterpriseNumber,
    "vkbo.name": clean(p.Maatschappelijke_naam),
    "vkbo.commercialName": clean(p.Commerciele_naam),
    "vkbo.abbreviation": clean(p.Afgekorte_naam),
    "vkbo.enterpriseType": clean(p.Type_onderneming),
    "vkbo.legalForm": clean(p.Rechtsvorm),
    "vkbo.legalSituation": clean(p.Rechtstoestand),
    "vkbo.startDate": dateOnly(p.Startdatum),
    "vkbo.address": formatAddress(p),
    "vkbo.postalCode": clean(p.KBO_Postcode),
    "vkbo.municipality": clean(p.KBO_Gemeente),
    "vkbo.nisCode": clean(p.KBO_NISCODE),
    "vkbo.latitude": coordinate(feature.geometry, 1),
    "vkbo.longitude": coordinate(feature.geometry, 0),
    "vkbo.phone": clean(p.Telefoonnummer),
    "vkbo.email": clean(p.Email),
    "vkbo.mainActivityCode": clean(p.NACE_hoofdact_BTW),
    "vkbo.mainActivity": clean(p.Omschrijving_hoofdact_BTW),
    "vkbo.naceVersion": clean(p.NACE_versie_BTW),
    "vkbo.employerActivityCode": clean(p.NACE_hoofdact_RSZ),
    "vkbo.employerActivity": clean(p.Omschrijving_hoofdact_RSZ),
    "vkbo.employeeClass": clean(p.Personeelsklasse),
    "vkbo.annualAccountsUrl": clean(p.JAARREK_URL_NBB),
  };

  // Leave out values the VKBO didn't return, so they don't overwrite existing data with blanks.
  Object.keys(data).forEach((key) => {
    if (data[key] === null) {
      delete data[key];
    }
  });

  return [{ Data: data, Score: 100 }];
}

response = JSON.stringify(run());