Skip to contents

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"`.

Value

A tibble (data frame) with the following columns:

  • nome: Brand name.

  • valor: FIPE code of the brand.

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.

Note

Requires internet connection. Only supports Brazilian vehicle types defined by BrasilAPI.

See also

Examples

if (FALSE) { # \dontrun{
# Retrieve list of car brands
cars <- get_brazil_vehicle_brands("carros")
head(cars)
} # }