PHP Classes
elePHPant
Icontem

Busca CEP: Get the address of a given CEP zip code in Brazil

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2015-06-27 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 234 This week: 1All time: 7,535 This week: 1,047Up
Version License PHP version Categories
busca-cep 0.1.3MIT/X Consortium ...5.4PHP 5, Web services, Geography
Description Author
This package is specific mainly for applications used in Brazil Brazil .

This class can get the address of a given CEP zip code in Brazil.

It can send an HTTP request to the Correios Web site to submit a form to get the address of a given CEP zip code.

The class parses the results page and extracts the zip code street, neighborhood, city and state.

In Portuguese:

Busca endereços no site dos correios baseado no CEP

Picture of Bruno Vaula Werneck
Name: Bruno Vaula Werneck <contact>
Classes: 1 package by
Country: Brazil Brazil

Details

BuscaCEP

Buscador de CEP

Classe que pesquisa CEP no site dos Correios e retorna o endereço completo se encontrar.

O retorno é feito em JSON, assim:

{
    "Logradouro" : "Avenida, Rua, Praça, etc",
    "Bairro" : "Bairro",
    "Cep" : "12345678",
    "Cidade" : "Cidade",
    "UF" : "UF"
}

Instruções

Instalação

composer require "brunowerneck/buscacep"

Ou edite seu composer.json e adicione

require : {
    "brunowerneck/buscacep" : "dev-master"
}

Execução

Para executar o sistema, basta chamar a classe:

> use BVW\Correios\BuscaCEP; > > $correios = new BuscaCEP(); > > $correios->busca($cep);

Você pode pesquisar o CEP nos formatos 00000-000 ou 00000000

  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageBVW (1 directory)

  Files folder image Files  /  src  /  BVW  
File Role Description
Files folder imageCorreios (1 file)

  Files folder image Files  /  src  /  BVW  /  Correios  
File Role Description
  Plain text file BuscaCEP.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:234
This week:1
All time:7,535
This week:1,047Up