PHP code example of adrianolaselva / fipeapi

1. Go to this page and download the library: Download adrianolaselva/fipeapi 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/ */

    

adrianolaselva / fipeapi example snippets


$client = new \FipeApi\Client([
    \FiapeApi\FipeApiParameter::FIPE_API_HOST  => "http://fipeapi.appspot.com/api/1/",
    \FiapeApi\FipeApiParameter::FIPE_API_TIMEOUT  => 20,
]);

$caminhaoApi = new \FipeApi\Api\Caminhao();

$caminhaoApi = new \FipeApi\Api\Caminhao($client);

$client = new \FipeApi\Client();

$client->setParameter(\FiapeApi\FipeApiParameter::FIPE_API_HOST, "http://fipeapi.appspot.com/api/1/");
$client->setParameter(\FiapeApi\FipeApiParameter::FIPE_API_TIMEOUT, 50);

$caminhaoApi = new \FipeApi\Api\Caminhao($client);