PHP sample code for API v1 queries
In order to install this library via composer run the following command in the console:
composer require curl/curl
or add the package manually to your composer.json file in the require section:
"curl/curl": "^2.0"
include 'vendor/autoload.php';
$curl = new Curl\Curl();
$params = array(
"token" => "5ae973d7a997af13f0aaf2bf60e65803",
"pacote" => 9,
"cpfcnpj" => '45317828791'
);
$curl->get('https://api.cpfcnpj.com.br/'.$params["token"].'/'.$params["pacote"].'/'.$params["cpfcnpj"]);
$curl->close();
$response = json_decode($curl->response, 1);
print_r($response);