PHPackages                             rafaellaurindo/laravel-brasilapi - 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. rafaellaurindo/laravel-brasilapi

ActiveLibrary[API Development](/categories/api)

rafaellaurindo/laravel-brasilapi
================================

A Laravel package that provides a simple way to use the Brasil API endpoints

v1.0.4(1y ago)623.5k↓11.1%2MITPHPPHP ^8.0CI passing

Since Nov 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rafaellaurindo/laravel-brasilapi)[ Packagist](https://packagist.org/packages/rafaellaurindo/laravel-brasilapi)[ Docs](https://github.com/rafaellaurindo/laravel-brasilapi)[ GitHub Sponsors](https://github.com/rafaellaurindo)[ RSS](/packages/rafaellaurindo-laravel-brasilapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (7)Versions (9)Used By (0)

Laravel Brasil API 🇧🇷
=====================

[](#laravel-brasil-api-)

[![Latest Stable Version](https://camo.githubusercontent.com/1d0e134d8361435085f9eb4ac8cac413568f53b6a84fcfd0a5df510fa60504ce/687474703a2f2f706f7365722e707567782e6f72672f72616661656c6c617572696e646f2f6c61726176656c2d62726173696c6170692f76)](https://packagist.org/packages/rafaellaurindo/laravel-brasilapi)[![Tests](https://camo.githubusercontent.com/3baabe9dc613ebee4f292531348df1c5a11628881be90b2e9e6b08e4ceccef65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616661656c6c617572696e646f2f6c61726176656c2d62726173696c6170692f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3Arun-tests+branch%3Amain)[![Code Style](https://camo.githubusercontent.com/1cac3f361945eb8f403b57589d598241941d461ee2ecc9eea2e5bd0273b7cf12/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616661656c6c617572696e646f2f6c61726176656c2d62726173696c6170692f7068702d63732d66697865722e796d6c3f6c6162656c3d636f64652532307374796c65)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![License](https://camo.githubusercontent.com/ce1b15de0b2220635c9e720ac93fb94a000d9dce73822df0afa1639bb2356b95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f72616661656c6c617572696e646f2f6c61726176656c2d62726173696c617069)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/1acaceed328577c0f3fdf66a8a8a8d91e68b384ed10b21dc458ca3617e9e205f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616661656c6c617572696e646f2f6c61726176656c2d62726173696c617069)](https://packagist.org/packages/rafaellaurindo/laravel-brasilapi)

**Laravel Brasil API** is a simple and elegant package to easily consume [Brasil API](https://brasilapi.com.br/) endpoints within your Laravel applications.

---

📑 Table of Contents
-------------------

[](#-table-of-contents)

- [Installation](#-installation)
- [Usage](#-usage)
- [Examples](#-examples)
- [Running Tests](#-running-tests)
- [Changelog](#-changelog)
- [Contributing](#-contributing)
- [Security Vulnerabilities](#-security-vulnerabilities)
- [Credits](#-credits)
- [License](#-license)

---

📦 Installation
--------------

[](#-installation)

> **Requirements:**
> This package supports **Laravel 8.0 and above**.

Install the package via Composer:

```
composer require rafaellaurindo/laravel-brasilapi
```

Optionally, you can publish the config file:

```
php artisan vendor:publish --provider="RafaelLaurindo\BrasilApi\BrasilApiServiceProvider" --tag="config"
```

---

🚀 Usage
-------

[](#-usage)

You can access the package using **Dependency Injection**, **Facade**, or **Helper**.

### 1. Using Dependency Injection

[](#1-using-dependency-injection)

```
use RafaelLaurindo\BrasilApi\BrasilApi;

class ExampleController
{
    public function searchZipCode(BrasilApi $brasilApi)
    {
        return response()->json($brasilApi->cep('01431000'));
    }
}
```

### 2. Using Facade

[](#2-using-facade)

```
use BrasilApi;

BrasilApi::cep('01431000');
```

### 3. Using Helper

[](#3-using-helper)

```
brasilApi()->getBank(77);
```

---

📚 Examples
----------

[](#-examples)

Make sure you import the Facade when using the examples:

```
use BrasilApi;
```

### 🔎 Search address by zip code

[](#-search-address-by-zip-code)

```
BrasilApi::cep('01431000');
```

### 🏦 List Brazilian banks

[](#-list-brazilian-banks)

```
BrasilApi::getBanks();
```

### 🏛️ Get a bank by its code

[](#️-get-a-bank-by-its-code)

```
BrasilApi::getBank(77);
```

### 🏢 Find company information by CNPJ

[](#-find-company-information-by-cnpj)

```
BrasilApi::findCnpj('19131243000197');
```

---

✅ Running Tests
---------------

[](#-running-tests)

To run the package tests, simply execute:

```
composer test
```

---

📋 Changelog
-----------

[](#-changelog)

Please refer to the [CHANGELOG](CHANGELOG.md) to learn about updates and changes.

---

🤝 Contributing
--------------

[](#-contributing)

Feel free to read the [CONTRIBUTING](.github/CONTRIBUTING.md) guide if you want to contribute to this project.

---

🔐 Security Vulnerabilities
--------------------------

[](#-security-vulnerabilities)

If you discover a security vulnerability, please review our [Security Policy](../../security/policy) for how to report it.

---

👨‍💻 Credits
-----------

[](#‍-credits)

- [Rafael Laurindo](https://github.com/rafaellaurindo)
- [All Contributors](../../contributors)

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance48

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 90.7% of commits — single point of failure

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 ~315 days

Total

5

Last Release

387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ec8f543ee45490cb981735eb44b00ee6edbdcab9dcbb799706b390dede4e97a?d=identicon)[rafaellaurindo](/maintainers/rafaellaurindo)

---

Top Contributors

[![rafaellaurindo](https://avatars.githubusercontent.com/u/25041169?v=4)](https://github.com/rafaellaurindo "rafaellaurindo (49 commits)")[![pedro-santiago](https://avatars.githubusercontent.com/u/6331494?v=4)](https://github.com/pedro-santiago "pedro-santiago (5 commits)")

---

Tags

banksbanks-listbrasilbrasilapicepcnpjlaravellaravel-frameworklaravel-packagelaravelcepbrasilBrasilApirafaellaurindo

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/rafaellaurindo-laravel-brasilapi/health.svg)

```
[![Health](https://phpackages.com/badges/rafaellaurindo-laravel-brasilapi/health.svg)](https://phpackages.com/packages/rafaellaurindo-laravel-brasilapi)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[spinen/laravel-clickup

SPINEN's Laravel Package for ClickUp.

282.2k](/packages/spinen-laravel-clickup)

PHPackages © 2026

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