% Generated by roxygen2: do not edit by hand % Please edit documentation in R/api.R \name{cep_lookup} \alias{cep_lookup} \title{Look up a single CEP} \usage{ cep_lookup(cep, client = default_client()) } \arguments{ \item{cep}{A length-one character vector: \code{"01001-000"} or \code{"01001000"}.} \item{client}{A \code{\link[=cepis_client]{cepis_client()}}. Defaults to a shared client built with the default configuration.} } \value{ A \link{cepis_address}. } \description{ Accepts the CEP masked or unmasked and returns everything the DNE database has for it, including the coordinate when there is one. } \section{Conditions}{ \describe{ \item{\code{cepis_invalid_cep}}{the CEP is not 8 digits. No request is made.} \item{\code{cepis_not_found}}{well-formed, but not in the database. Carries \code{faixa}, a \link{cepis_faixa} naming the municipality whose range the CEP fell into, when it fell into one. Still a not-found: the CEP does not exist, and a \code{faixa} is not an address.} \item{\code{cepis_rate_limited}}{429 on every attempt.} \item{\code{cepis_server_error}}{5xx on every attempt.} \item{\code{cepis_network_error}}{the request never completed.} \item{\code{cepis_invalid_response}}{a success status with an unreadable body.} } All of them inherit \code{cepis_error}; see \link{cepis_conditions}. } \examples{ \donttest{ address <- cep_lookup("01001-000") address$localidade if (!is.null(address$geo) && address$geo$is_precise) { c(address$geo$lat, address$geo$lon) } } }