AIG - Address Info Getter
Goldbach Algorithms Address Info Getter (fondly nicknamed AIG) is a PHP library developed for Symfony to collect address information.
Installation
Use the composer to install:
composer require goldbach-algorithms/aig
Usage
Create an AIG instance and look for the address indicating or not the source of access.
# Add use AIG
use GoldbachAlgorithms\AIG\AIG;
# create a new AIG
$aig = new AIG();
# get address by CEP
$aig->getAddressByCep('89566410');
# get address by cep using a specific source
$aig->getAddressByCep('89304258', AIG::SOURCE_CORREIOS);
$aig->getAddressByCep('89304258', AIG::SOURCE_VIACEP);
Return
Look at an example of a JSON return displaying the source of the information.
{
"zipCode": "89304258",
"street": "Rua Pioneiro Arlindo Goldbach",
"complement": "",
"neighborhood": "Vila Nova",
"city": "Mafra",
"state": "SC",
"source": "Correios"
}
License
Copyright © 2021 Goldbach Algorithms