Documentation / Filtering & search

API BCE search and filters: query, limit and pagination

API BCE search: filter and page results by company name, NACE code or legal form with the q, limit, page and pageSize parameters, with examples.

Search and reference endpoints accept a q query parameter and a limit to cap the number of rows returned.

Search by name#

Use /denominations for type-ahead over enterprise names.

curl "https://companybelgium.be/api/v2/denominations?q=espero&limit=5" \
  -H "X-API-Key: $API_BCE_KEY" -H "X-API-Secret: $API_BCE_SECRET"

Search NACE activities#

Filter NACE codes by substring and classification version.

curl "https://companybelgium.be/api/v2/naces?q=programmation&version=2008&limit=10" \
  -H "X-API-Key: $API_BCE_KEY" -H "X-API-Secret: $API_BCE_SECRET"
ℹ️

Sub-resource lists (activities, establishments, roles…) return the full set for a given entity and do not require paging.

Building a type-ahead with API BCE#

The /denominations route powers a “search by company name” field. However, every keystroke can become a request, so a naive input burns quota quickly. First, wait until the user has typed at least 2 characters, since q requires them. Then, debounce the input and cancel requests that are no longer current. Finally, set limit to a small value: the default is 20 and the maximum is 50.

Once the user picks a suggestion, fetch the full record with /enterprise/{num}. As a result, you pay for one detailed call instead of many.

Paging through address results#

  • page is 1-based, and each page holds 20 results by default.
  • pageSize goes up to 100 and also accepts the alias limit.
  • The response returns totalResults, currentPage and totalPages.
  • Stop your loop when currentPage equals totalPages.
  • Add houseNumber to narrow a busy street before paging at all.

Filtering reference lists#

The /naces route accepts q, a classification version such as 2008 or 2025, and a limit (50 by default, 200 at most). In addition, /juridical-forms and /juridical-situations take an optional q. These lists are small, so one call usually returns everything you need for a dropdown.

Sub-resource lists work differently. Activities, establishments and roles return the full set for an entity, therefore they need no paging at all.

Search patterns that save quota with API BCE#

Good search design saves both quota and user time. First, cache recent suggestions for a short while, because users often retype the same prefix. Second, show the enterprise number next to each suggestion, so users can tell similar names apart. Third, when a user pastes a full enterprise number, skip the search and call the enterprise endpoint directly. In addition, log empty searches. They reveal typos and naming habits that you can handle with hints in your interface.

For address searches, the same logic applies. Start with the street and the postal code, then let the user narrow the list with a house number. As a result, most searches end on the first page, and deeper pages load only on demand.

Why are my name suggestions capped?

The limit on /denominations stops at 50. So, ask the user for a more precise term instead of raising the limit.

Does each page count as a request?

Yes. Each page is a separate HTTP call, therefore it counts as one request. A larger pageSize means fewer calls.

Do I need to page through the activities of a company?

No. Sub-resource lists return the full set for the given entity in one response.