Back to integrations
PHP SDK4 min read

Kooperativa SDK for PHP

For PHP projects and Composer-based codebases calling the Kooperativa API directly from code.

kooperativa/sdkView package

Same shape as the Node and Python SDKs: a single `Kooperativa` object with `person`, `company`, and `monitors` properties, each holding a method per operation, named to match PHP conventions (camelCase). It depends on nothing beyond the `curl` and `json` extensions already bundled with most PHP installs, no Guzzle or PSR-18 client to pull in.

Every call returns the parsed JSON response as an associative array. Errors throw `Kooperativa\KooperativaApiError`, exposing `getStatus()` and `getApiCode()` so calling code can branch on the same stable error codes documented for the API.

Installing it

Not on Packagist yet. Add the GitHub repository as a VCS source in composer.json, then require it as usual, see the package README for the exact repositories block.

Enrich a personphp
<?php
require 'vendor/autoload.php';

use Kooperativa\Kooperativa;

$kooperativa = new Kooperativa($_ENV['KOOPERATIVA_API_KEY']);
$profile = $kooperativa->person->enrich(username: 'satyanadella');
echo $profile['data']['full_name'];

Get started

Try Kooperativa

One API key. Every endpoint behind this integration, and every other one, included on the same flat license with unlimited requests.

More integrations