Skip to content

SDKs

Client libraries also exist for some languages. They are maintained by the community, not by Boavizta: report bugs to their own repositories.

Language Library Maintainer Status
PHP boaviztapi-php @DavidJLN Community, unofficial

PHP

boaviztapi-php covers the v1 routes and requires PHP 8.2+. It works with any PSR-18 HTTP client.

composer require davidjln/boaviztapi-php symfony/http-client nyholm/psr7

Climate impact of one year of an AWS a1.4xlarge instance:

use Boavizta\Api\BoaviztaClient;
use Boavizta\Api\Enum\Criterion;
use Boavizta\Api\Request\ImpactOptions;

$client = BoaviztaClient::create();
$result = $client->cloud()->instanceImpact('aws', 'a1.4xlarge', new ImpactOptions(duration: 8760));

$gwp = $result->impact(Criterion::Gwp);
echo $gwp->embedded->value . ' ' . $gwp->unit; // manufacturing impact

See the library's README for configuration (timeout, cache, errors).

Add your SDK

Open a pull request on boaviztapi that adds a row to the table above and to SDKs.md at the root of the repository.