PHP Classes

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

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 254 All time: 7,870 This week: 455Up
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
Age: 47
All time rank: 3971321 in Brazil Brazil
Week rank: 170 Up12 in Brazil Brazil Up

Documentation

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 (4)  
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 (4)  /  src  
File Role Description
Files folder imageBVW (1 directory)

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

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:254
This week:0
All time:7,870
This week:455Up