/ViaCep-Api

This api generates an address (in Brazil) from a zip code.

Primary LanguageJava

ViaCep-Api

Status: Finished ✔️

Contents

What is it?

  • This API search a address in the ViaCep API and returns a Json with the some of his foremost information of that address;
  • The base url that this api consumes is https://viacep.com.br/ws/{cep}/json

Requirements

  • Java 11+
  • Spring Boot
  • Lombok

Technologies Used

  • Java
  • Spring Boot (version 2.7.7)
  • Spring Cloud
  • Lombok
  • Model Mapper

Installation

  • Clone the repository for your device;
  • Import it as a MAVEN project.

Run Application

  • After meeting the requirements and installation, run the main method in IsbnApplication.java at a spring boot app;
  • Make a HTTP GET request at http://localhost:8080/cep/{cep};
  • You'll get the ensuring Json return:

{
  "cep":"24020-125",
  "logradouro":"Rua Quinze de Novembro",
  "complemento":"",
  "bairro":"Centro",
  "localidade":"Niterói",
  "uf":"RJ"
}