View source: R/get_brazil_cnpj.R
get_brazil_cnpj | R Documentation |
This function retrieves public company registration data in Brazil by querying the BrasilAPI endpoint.
get_brazil_cnpj(cnpj)
cnpj |
A valid CNPJ number as a string (only digits, no punctuation). |
Example URL format: https://brasilapi.com.br/api/cnpj/v1/19131243000197
Replace 19131243000197
with any valid Brazilian CNPJ number.
It returns a tibble with essential information such as the company's legal name, trade name, address, primary activity, and registration status.
The function makes an HTTP GET request to the BrasilAPI CNPJ endpoint and processes the JSON response into a structured tibble. It only returns fields that are essential and informative for the user.
A tibble with selected essential fields:
cnpj
: CNPJ identifier.
razao_social
: Legal name.
nome_fantasia
: Trade name.
capital_social
: Registered capital (numeric).
data_inicio_atividade
: Start date of activities.
cnae_fiscal_descricao
: Main economic activity.
natureza_juridica
: Legal nature.
descricao_situacao_cadastral
: Registration status.
municipio
: City.
uf
: State.
cep
: Postal code.
logradouro
: Address (street).
numero
: Address number.
bairro
: Neighborhood.
Requires internet connection. The function returns NULL
if the CNPJ is invalid or not found.
GET
, fromJSON
, as_tibble
## Not run:
get_brazil_cnpj("19131243000197")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.