kvk_get_basisprofiel: Retrieve the Basisprofiel for a given KvK number

View source: R/kvk_retrieve.R

kvk_get_basisprofielR Documentation

Retrieve the Basisprofiel for a given KvK number

Description

This function retrieves the basis profile for a given KvK number (kvkNummer) using the KvK Basisprofiel API. Users can also request additional data, such as owner information, main establishment, and other locations by specifying the include parameter.

Usage

kvk_get_basisprofiel(
  kvkNummer,
  geoData = FALSE,
  include = NULL,
  test_environment = FALSE
)

Arguments

kvkNummer

A string representing the KvK number for which the basis profile is requested.

geoData

A logical value indicating whether geo-data should be included in the response. Defaults to FALSE. If TRUE, the response will include geo-data.

include

A character vector specifying additional data to include. Possible values: "eigenaar" (owner), "hoofdvestiging" (main establishment), "vestigingen" (locations). Defaults to NULL (basic profile only).

test_environment

A logical value indicating whether to use the test environment (TRUE) or the production environment (FALSE). Defaults to FALSE.

Details

The function also supports the test_environment argument. When set to TRUE, the function will query the KvK test API environment, providing a set of fictitious test data.

The function retrieves data from the KvK Basisprofiel API. If geoData = TRUE, geo-data (e.g., location data) will be included in the returned profile. The include parameter allows users to request additional details, such as ownership information or business locations.

Important: If test_environment = TRUE, no actual API key is required. You will be using test data from the KvK test environment.

Value

A tibble containing the retrieved basis profile. If geoData = TRUE, the returned tibble will also include geographical information.

Examples


# Examples using the production API (requires API key)
# Retrieve basis profile for a given KvK number without geo-data
basis_profile <- kvk_get_basisprofiel(kvkNummer = "69599084")
print(basis_profile)

# Retrieve basis profile with geo-data
basis_profile_geo <- kvk_get_basisprofiel(kvkNummer = "69599084", geoData = TRUE)

# Retrieve basis profile including owner information
basis_profile_owner <- kvk_get_basisprofiel(kvkNummer = "69599084", include = "eigenaar")

# Examples using test environment (no API key required)
# These use the KvK test dataset with Donald Duck themed businesses
basis_profile_test <- kvk_get_basisprofiel(kvkNummer = "68727720", test_environment = TRUE)
print(basis_profile_test)


kvkapiR documentation built on June 25, 2025, 5:11 p.m.