PHP Classes
elePHPant
Icontem

PHP Busca CEP Correios: API to search for Brazilian zip codes

Recommend this page to a friend!
  Info   View files Example   View files View files (43)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-06-27 (25 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 58 This week: 5All time: 9,502 This week: 64Up
Version License PHP version Categories
busca_cep 1.0.0MIT/X Consortium ...5PHP 5, Web services, Geography
Description Author
This package is specific mainly for applications used in Brazil Brazil .

This package provides an API to search for Brazilian zip codes.

It provides an API that can perform searches for zip codes in Brazil based on the city or state, or get the location associated to a given zip code.

In Portuguese:

Este componente pode realizar pesquisas de CEP usando uma API desenvolvida com Lumen.

Ele fornece uma API que pode realizar pesquisas por códigos postais no Brasil com base na cidade ou estado ou obter o local associado a um determinado CEP.

Innovation Award
PHP Programming Innovation award nominee
June 2019
Nominee
Vote
Correios is a postal service company that delivers postal mail and parcels sent or received in Brazil.

This package provides an API that can be called by applications to inquire about information of interest to be used when sending postal mail or shipping parcels using the Correios service like zip codes of cities or addresses associated to a zip code.

Manuel Lemos
  Performance   Level  
Name: Thiago Przyczynski <contact>
Classes: 4 packages by
Country: Brazil Brazil
Age: 30
All time rank: 4024333 in Brazil Brazil
Week rank: 17 Up1 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 1x

 

Details

Busca CEP

Projeto com o fim de disponibilizar informações de CEP sobre logradouros e cidades em uma api simplificada. Framework utilizado:Lumen*

Banco de Dados

O banco de dados atualmente é formado por 3 entidades, sendo elas: estado, cidade e cep.

Endpoints da API

Estado

Para pesquisa de CEP por estado está disponível o método api/v1/estado/{cep}, onde {cep} é o número de CEP a ser pesquisado. Podendo ser no formato 99.999-99, 99999-99 ou 9999999.

Cidade

Para pesquisa de CEP por cidade está disponível o método api/v1/cidade/{cep}, onde {cep} é o número de CEP a ser pesquisado. Podendo ser no formato 99.999-99, 99999-99 ou 9999999.

CEP (Logradouro)

Para pesquisa de CEP por logradouro está disponível o método api/v1/cep/{cep}, onde {cep} é o número de CEP a ser pesquisado. Podendo ser no formato 99.999-99, 99999-99 ou 9999999.

Instalação

Para instalar basta configurar o ambiente criando o arquivo .env com base no arquivo .env.example e rodar composer install para instalar as dependências e php artisan migrate para que o banco de dados seja montado com as tabelas necessárias.

Requisitos

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension

Dados de demonstração

No seguinte link é possível baixar um arquivo SQL com os inserts de dados para testar o uso da API, nele estão contidos ceps de todos os estados e cidades que consegui obter. Dados de Exemplo.sql

Licença

Licenciado sobre a licença MIT license

  Files folder image Files  
File Role Description
Files folder imageapp (2 files, 8 directories)
Files folder imagebootstrap (1 file)
Files folder imagedatabase (3 directories)
Files folder imagepublic (2 files)
Files folder imageroutes (1 file)
Files folder imagetests (2 files)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file artisan Example Example script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file Procfile Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageEvents (2 files)
Files folder imageExceptions (1 file)
Files folder imageHttp (2 directories)
Files folder imageJobs (2 files)
Files folder imageListeners (1 file)
Files folder imageModels (3 files)
Files folder imageProviders (3 files)
  Plain text file Application.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Events  
File Role Description
  Plain text file Event.php Class Class source
  Plain text file ExampleEvent.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (2 files)
Files folder imageMiddleware (2 files)

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file CepController.php Class Class source
  Plain text file Controller.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file ExampleMiddleware.php Class Class source

  Files folder image Files  /  app  /  Jobs  
File Role Description
  Plain text file ExampleJob.php Class Class source
  Plain text file Job.php Class Class source

  Files folder image Files  /  app  /  Listeners  
File Role Description
  Plain text file ExampleListener.php Class Class source

  Files folder image Files  /  app  /  Models  
File Role Description
  Plain text file Cep.php Class Class source
  Plain text file Cidade.php Class Class source
  Plain text file Estado.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (8 files)
Files folder imageseeds (1 file)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file ModelFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2017_02_15_000051_create_cache_table.php Class Class source
  Plain text file 2017_02_17_194131_...te_estado_table.php Class Class source
  Plain text file 2017_02_17_194132_...te_cidade_table.php Class Class source
  Plain text file 2017_02_17_194133_create_cep_table.php Class Class source
  Plain text file 2017_02_19_234332_alter_cidade_table.php Class Class source
  Plain text file 2017_02_19_234341_alter_cep_table.php Class Class source
  Plain text file 2017_02_20_133456_alter_estado_table.php Class Class source
  Plain text file 2017_02_27_120713_alter_cidade_table.php Class Class source

  Files folder image Files  /  database  /  seeds  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file web.php Example Example script

  Files folder image Files  /  tests  
File Role Description
  Plain text file ExampleTest.php Class Class source
  Plain text file TestCase.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:58
This week:5
All time:9,502
This week:64Up