PHP code example of kenowlee / oxi-brasil-api

1. Go to this page and download the library: Download kenowlee/oxi-brasil-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kenowlee / oxi-brasil-api example snippets




(new Brasil\Api)->banco('341');

//resultado
Array
(
    [ispb] => 60701190
    [name] => ITAÚ UNIBANCO S.A.
    [code] => 341
    [fullName] => ITAÚ UNIBANCO S.A.
)


(new Brasil\Api)->bancos();

//resultado
Array
(
    [0] => Array
        (
            [ispb] => 00000000
            [name] => BCO DO BRASIL S.A.
            [code] => 1
            [fullName] => Banco do Brasil S.A.
        )

    [1] => Array
        (
            [ispb] => 00000208
            [name] => BRB - BCO DE BRASILIA S.A.
            [code] => 70
            [fullName] => BRB - BANCO DE BRASILIA S.A.
        )
...

(new Brasil\Api)->banco('341');

//resultado
Array
(
    [ispb] => 60701190
    [name] => ITAÚ UNIBANCO S.A.
    [code] => 341
    [fullName] => ITAÚ UNIBANCO S.A.
)


//Só as marcas das Motoca
(new Brasil\Api)->motos();

//Só as Naves
(new Brasil\Api)->carros();

//Aqui só os gigantes hein!
(new Brasil\Api)->caminhoes();

//resultado das Motoca
Array
(
    [0] => Array
        (
            [nome] => ADLY
            [valor] => 60
        )

    [1] => Array
        (
            [nome] => AGRALE
            [valor] => 61
        )

    [2] => Array
        (
            [nome] => APRILIA
            [valor] => 62
        )
...

(new Brasil\Api)->cep('18013900');

Array
(
    [cep] => 18013900
    [state] => SP
    [city] => Sorocaba
    [neighborhood] => Jardim do Paço
    [street] => Avenida Engenheiro Carlos Reinaldo Mendes
    [service] => viacep
    [location] => Array
        (
            [type] => Point
            [coordinates] => Array
                (
                    [longitude] => -47.428788
                    [latitude] => -23.4858059
                )
        )
)


(new Brasil\Api)->feriados('2021');

(new Brasil\Api)->cnpj('12345678901234');

(new Brasil\Api)->estados();

(new Brasil\Api)->estado('SP');

(new Brasil\Api)->municipios('SP');

(new Brasil\Api)->fipe('SP');

(new Brasil\Api)->precofipe('codigo-fipe');

(new Brasil\Api)->ddd('11');