Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Exads API PHP Client

A simple Object Oriented wrapper for Exads API, written with PHP5.

See Exads API's documentation.


  • Follows PSR-0 conventions and coding standard: autoload friendly
  • API entry points implementation state :
  • Campaign
  • Collection
  • Login
  • Payment
  • Site
  • Statistics
  • User
  • Zones


  • PHP >= 5.4
  • The PHP cURL extension
  • The PHP JSON extension
  • PHPUnit >= 4.0 (optional) to run the test suite



Composer users can simply run:

$ composer require exads/exads-api-client-php

at the root of their projects. To utilize the library, include Composer's vendor/autoload.php in the scripts that will use the Exads classes.

For example,


// This file is generated by Composer
require_once 'vendor/autoload.php';

$client = new Exads\Client('');
// ...

The library ships with a basic autoload.php file which allows you to use it without composer. See the latest version available :

$ mkdir vendor
$ wget -q
$ tar -xf v1.3.0.tar.gz -C vendor/
$ rm v1.3.0.tar.gz

Then your bootstrap script should look like :


// This file ships with the library
require 'vendor/exads-api-client-php-1.2.2/lib/autoload.php';

$client = new Exads\Client('');

Basic usage of exads-api-client-php client


require_once 'vendor/autoload.php';

try {
    $client = new Exads\Client('');

    // There are two authentication methods:
    // a. with username and password
    $sessionToken = $client->login->getToken('username', 'password');
    // b. with APItoken
    // $sessionToken = $client->login->getToken('APItoken');

    // ...
    $campaigns = $client->campaigns->all();
    // ...
} catch (\Exception $e) {

See test/Exads/Tests/UrlsTest.php for a full list of available methods.

Passing parameters to end points

As describe in the API documentation, most of the GET entry points accept parameters for filtering the result of the call. In particular, for long collections, you should use offset for paginating the results the API returns (you cannot get more than 50 elements out of 1 call, that's when offset comes in play). See the following examples :


// Getting the total number of carriers
$client->collections->carriers(array('count' => true));

// Getting the carriers 50..100
$client->collections->carriers(array('offset' => 50));

Please refer to the documentation for the full list of parameters allowed for each entry point.