PHPackages                             pbozzi/correios - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pbozzi/correios

ActiveLibrary[API Development](/categories/api)

pbozzi/correios
===============

Biblioteca para consulta do CEP nos Correios.

v1.0.4(8y ago)038MITPHPPHP &gt;=5.0.1

Since Jun 16Pushed 8y ago3 watchersCompare

[ Source](https://github.com/pbozzi/correios)[ Packagist](https://packagist.org/packages/pbozzi/correios)[ RSS](/packages/pbozzi-correios/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/bed389d5a6eba694ca048cae7c72e9854834a6acc0a903ca1e3a5760e5435477/68747470733a2f2f7472617669732d63692e6f72672f70626f7a7a692f636f727265696f732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pbozzi/correios)[![Coverage Status](https://camo.githubusercontent.com/e1e160fd06b35c81f98adc189ebf5bda549d28fd7f62459189623dd579265337/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70626f7a7a692f636f727265696f732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/pbozzi/correios?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9fc1a7412cf2deaadfa632c528afe56ce7573c4faec416b289034162b16572dd/68747470733a2f2f706f7365722e707567782e6f72672f70626f7a7a692f636f727265696f732f646f776e6c6f616473)](https://packagist.org/packages/pbozzi/correios)[![Latest Stable Version](https://camo.githubusercontent.com/774d4f69763732f13864efbb9d992c2c483ae4cd5ac4c32bd1822815ea669ad2/68747470733a2f2f706f7365722e707567782e6f72672f70626f7a7a692f636f727265696f732f762f737461626c65)](https://packagist.org/packages/pbozzi/correios)[![License](https://camo.githubusercontent.com/c13c84567943b9149b68a98e48193802358a0eea4f6f86bd3a1e56bcb6803fc1/68747470733a2f2f706f7365722e707567782e6f72672f70626f7a7a692f636f727265696f732f6c6963656e7365)](https://packagist.org/packages/pbozzi/correios)

Correios
========

[](#correios)

Biblioteca para consulta do endereço do CEP informado. 2 métodos possíveis:

1. consultarCEP: consulta na base de dados dos Correios
2. consultarCEPViaCEP: consulta na base de dados do site ViaCEP (melhor desempenho)

Instalação
----------

[](#instalação)

```
$ composer require pbozzi/correios
```

Utilização
----------

[](#utilização)

```
use pbozzi\correios\Correios;

...

$cep = "01310200"; // ou "01310-200";
$ret = Correios::consultaCEP($cep); // ou Correios::consultaCEPViaCEP($cep)

if (isset($ret) && $ret['error'] == false)
{
    $data['nme_logradouro'] = $ret['endereco']['logradouro'];
    $data['nme_complemento'] = $ret['endereco']['complemento'];
    $data['nme_complemento2'] = $ret['endereco']['complemento2'];
    $data['nme_bairro'] = $ret['endereco']['bairro'];
    $data['nme_cidade'] = $ret['endereco']['cidade'];
    $data['cod_uf'] = $ret['endereco']['uf'];

    return $data;
}
else
{
    return [
        'error' => true,
        'message' => "CEP não encontrado."
    ];
}
```

Retorno
-------

[](#retorno)

```
Array (
    [error] => false
    [endereco] => Array (
        [cep] => 01310200
        [logradouro] => Avenida Paulista
        [complemento] =>
        [complemento2] => - de 1512 a 2132 - lado par
        [bairro] => Bela Vista
        [cidade] => São Paulo
        [uf] => SP
    )
)

```

Requisitos
----------

[](#requisitos)

- PHP &gt;=5.0.1

Package
-------

[](#package)

Licença
-------

[](#licença)

MIT License

Copyright (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity62

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

5

Last Release

3228d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38fa48bbc6b2a9114cbdd8e216b64624e1d1e95b2348c4514ab6e4e9d5e754a5?d=identicon)[pbozzi](/maintainers/pbozzi)

---

Tags

apicorreioscepwebservice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pbozzi-correios/health.svg)

```
[![Health](https://phpackages.com/badges/pbozzi-correios/health.svg)](https://phpackages.com/packages/pbozzi-correios)
```

###  Alternatives

[njasm/soundcloud

Soundcloud API Wrapper written in PHP with OAuth 2.0 support

100161.8k2](/packages/njasm-soundcloud)[jhowbhz/apigratis-sdk-php

This package is free and can be used for API Brazil website functions

183.6k](/packages/jhowbhz-apigratis-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
