get_brazil_vehicle_brands {BrazilDataAPI} | R Documentation |
Get Vehicle Brands from BrasilAPI (FIPE Data)
Description
This function retrieves a list of vehicle brands in Brazil using the BrasilAPI endpoint, which provides data sourced from FIPE (Fundação Instituto de Pesquisas Econômicas). The user must specify the type of vehicle: '"carros"', '"motos"', or '"caminhoes"'.
Usage
get_brazil_vehicle_brands(tipo_veiculo)
Arguments
tipo_veiculo |
A string indicating the type of vehicle. Must be one of '"carros"', '"motos"', or '"caminhoes"'. |
Details
This function sends a GET request to the BrasilAPI endpoint and parses the list of vehicle brands.
If the API returns an error (e.g., invalid vehicle type), the function will return NULL
.
Value
A tibble (data frame) with the following columns:
-
nome
: Brand name. -
valor
: FIPE code of the brand.
Note
Requires internet connection. Only supports Brazilian vehicle types defined by BrasilAPI.
See Also
Examples
## Not run:
# Retrieve list of car brands
cars <- get_brazil_vehicle_brands("carros")
head(cars)
## End(Not run)
[Package BrazilDataAPI version 0.1.0 Index]