Learn R Programming

kvkapiR (version 0.1.2)

kvk_get_naamgeving: Retrieve the Naamgeving for a given KvK number

Description

This function retrieves the name information (naamgeving) for a given KvK number (kvkNummer) using the KvK Naamgevingen API.

Usage

kvk_get_naamgeving(kvkNummer, test_environment = FALSE)

Value

A tibble containing the retrieved name information.

Arguments

kvkNummer

A string representing the KvK number for which the name information is requested.

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 Naamgevingen API.

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

Examples

Run this code
if (FALSE) { # nzchar(Sys.getenv("KVK_API_KEY"))
# Examples using the production API (requires API key)
# Retrieve naamgeving for a given KvK number
naamgeving <- kvk_get_naamgeving(kvkNummer = "68750110")
print(naamgeving)

# Examples using test environment (no API key required)
naamgeving_test <- kvk_get_naamgeving(kvkNummer = "68727720", test_environment = TRUE)
print(naamgeving_test)
}

Run the code above in your browser using DataLab