Documentation / Quickstart

API BCE quickstart: your first API call in 5 minutes

API BCE quickstart: get a free key, authenticate and make your first call in three steps, with ready-to-run cURL, JavaScript and Python examples.

This guide takes you from nothing to a working request in three steps.

1. Get your API key#

Create an account in the developer portal and generate an API key and an API secret. Keep the secret private: treat it like a password.

2. Make your first request#

Fetch a single enterprise by its BCE number. Send both credential headers on every call.

curl https://companybelgium.be/api/v2/enterprise/1033.022.383 \
  -H "X-API-Key: $API_BCE_KEY" \
  -H "X-API-Secret: $API_BCE_SECRET"
const res = await fetch(
  "https://companybelgium.be/api/v2/enterprise/1033.022.383",
  {
    headers: {
      "X-API-Key": process.env.API_BCE_KEY,
      "X-API-Secret": process.env.API_BCE_SECRET,
    },
  }
);
const { success, data } = await res.json();
import os, requests

r = requests.get(
    "https://companybelgium.be/api/v2/enterprise/1033.022.383",
    headers={
        "X-API-Key": os.environ["API_BCE_KEY"],
        "X-API-Secret": os.environ["API_BCE_SECRET"],
    },
)
payload = r.json()
print(payload["data"])

3. Read the response#

Every successful response is wrapped in a consistent envelope. The payload you want is under data.

{
  "success": true,
  "data": {
    "enterpriseNumber": "1033.022.383",
    "name": "ESPERO-SOFT INFORMATIQUES",
    "status": "Active",
    "statusCode": "AC"
  },
  "timestamp": "...",
  "meta": { "responseTime": "..." }
}
ℹ️

That’s it. From here, explore the Enterprise reference for every available field and related sub-resources.

From first call to a working feature#

The quickstart proves that your credentials work. The next step is to turn that single call into a feature your users rely on. For instance, a signup form can ask for an enterprise number, call the enterprise endpoint and prefill the name and address. As a result, users type less and your database receives cleaner data.

  • Store the key and the secret in environment variables, never in source code.
  • Wrap the HTTP call in one small function that adds both headers and reads the envelope.
  • Check the HTTP status and success before you read data.
  • Log the X-RateLimit-Remaining header so you notice heavy usage early.
  • Read the base URL from configuration, so the same code runs against the test API and the live API.

Start in test mode with API BCE#

You do not need to spend quota while you experiment. Instead, create a pk_test_ and sk_test_ key pair and call https://api-bce.be/test/v2. The test API serves the same routes, envelope and error codes with fictitious companies. For example, 0999.999.130 returns an active company with full data, while 0999.999.999 returns a 400 error. Then, once your flow works, swap the base URL and use a live key.

Mistakes that slow down a first integration#

First, the enterprise number accepts several formats, such as 1033.022.383 or BE1033022383. Therefore, you rarely need to reformat user input. Second, a 401 response usually means a missing header, because both X-API-Key and X-API-Secret are required. Finally, remember that the payload sits under data, not at the root of the JSON body.

Also, avoid testing with random numbers. A made-up number often fails the check digits, so you only see 400 errors and learn little. The documented test numbers cover each case on purpose.

Once the first feature works, measure it. For example, count how many lookups a typical user triggers per session. Then, compare that figure with your plan: the free plan allows 2,000 requests per month and 300 per hour. As a result, you know early whether a paid plan is needed, and you can try one free for 7 days.

API BCE quickstart FAQ#

How do I get my first key?

Create an account in the developer portal, then generate a key and a secret. The free plan needs no credit card, so you can start right away.

Can I call API BCE from a frontend app?

No. The secret must stay on your server. Instead, call the API from your backend and send only the result to the browser or the mobile app.

What should I build after the first call?

Most projects add a name search with /denominations next, then a VAT check with /vat/{vatNumber}. The examples page shows both calls.