This function retrieves detailed address information for a given Brazilian postal code (CEP) using the BrasilAPI endpoint.
Value
A data frame (tibble) with the following columns:
cep
: The CEP (postal code).state
: State abbreviation (e.g., SP, RJ).city
: City or municipality.neighborhood
: Neighborhood.street
: Street name.service
: Name of the API service used.
Details
Example URL format: https://brasilapi.com.br/api/cep/v1/89010025
Replace 89010025
with any valid Brazilian postal code (CEP).
The function sends a GET request to the BrasilAPI CEP endpoint. If the request
is successful and the response contains the expected fields, it returns a
structured tibble. Otherwise, a message is displayed and NULL
is returned.