PHPackages                             traackr/traackr-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. traackr/traackr-api-php

ActiveLibrary[API Development](/categories/api)

traackr/traackr-api-php
=======================

Traackr API PHP Library

1.3.0(3mo ago)559.8k↑921.4%1[4 issues](https://github.com/Traackr/traackr-api-php/issues)[3 PRs](https://github.com/Traackr/traackr-api-php/pulls)PHPPHP &gt;=7.2CI passing

Since Jan 15Pushed 1mo ago16 watchersCompare

[ Source](https://github.com/Traackr/traackr-api-php)[ Packagist](https://packagist.org/packages/traackr/traackr-api-php)[ Docs](https://traackr.com/)[ RSS](/packages/traackr-traackr-api-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (78)Used By (0)

Traackr API - PHP Client
========================

[](#traackr-api---php-client)

[![Build Status](https://camo.githubusercontent.com/22068d318d9efd57ad21ac290118139120b5e1bb7c1149a07c3eba6176c7ab56/68747470733a2f2f7472617669732d63692e6f72672f54726161636b722f74726161636b722d6170692d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Traackr/traackr-api-php)

Introduction
------------

[](#introduction)

This is a PHP implementation of the Traackr API. Documentation for this PHP client is available here: .
For documentation for the Traackr API itself, see: .

Installation
------------

[](#installation)

You can clone this GitHub repository to get the latest version of the code.

This library is also available via Composer if that's what you use to manage your dependencies. To do this, simply add this to your `composer.json` file:

```
"minimum-stability": "dev",
"require": {
	"traackr/traackr-api-php": "dev-master"
}

```

Usage
-----

[](#usage)

You will need an API key to make use this library. Contact  to get your key.

### Include the library

[](#include-the-library)

You include this library with:

```
require_once('lib/TraackrApi.php');

```

If you are using Composer the autoload functionality should automatically load the appropriate PHP files (i.e. `require 'vendor/autoload.php'` will load the library files).

### Set your API key

[](#set-your-api-key)

To set your API key use:

```
TraackrApi::setApiKey();

```

Some calls require a Customer Key (see [documentation](http://iodocs.traackr.com)). You do not need to pass this key to these calls. You can set (once and for all) your Customer Key with:

```
TraackrApi::setCustomerKey( Note that you can also specify your API key and customer key via environment variables. See the unit tests section.

### API calls

[](#api-calls)

All API calls map to static functions with parameters matching the API call parameters (see [documentation](http://iodocs.traackr.com)). For instance to call `/influencers/show` you can use:

```
Influencers::show();

```

### Logging

[](#logging)

You can tie the client's internal logging into your own application's logging by creating an implementation of the `ApiLoggingInterface`. Here's an example from CakePHP:

```
class ApiLogger implements Traackr\ApiLoggerInterface
{
   private $parentObj;

   public function __construct($obj) {
      $this->parentObj = $obj;
   }

   public function debug($string) {
      $this->parentObj->log($string, LOG_DEBUG);
   }

   public function error($string) {
      $this->parentObj->log($string, LOG_WARNING);
   }
}

```

Then, create an instance of your implementation before any API calls are made (e.g. in a constructor):

```
Traackr\TraackrApi::setLogger(
   new ApiLogger($this)
);

```

Unit Tests
----------

[](#unit-tests)

### Setup

[](#setup)

To run unit tests, you will need to install dependencies required by this project. First, install Composer locally:

```
$ curl -sS https://getcomposer.org/installer | php

```

Then install dependencies:

```
$ php composer.phar install

```

### Running the tests

[](#running-the-tests)

The unit tests come with a public API key that you can use to run the unit tests. However the API key provided in the unit tests is only allowed to access read-only end points (i.e. API calls that do not add, modify or delete any data).
To run these read-only tests you can execute:

```
./bin/phpunit --group read-only test

```

If you try to run the entire test suite with this public API key you will get errors when trying to access functions that change data.

### Running the entire test suite

[](#running-the-entire-test-suite)

To run the entire test suite you will need an API key that has full access to the API. You can request one by emailing api-support@traackr.com.

Before you run unit tests, you need to specify an API key and a Customer key. These 2 values can be specified via ENV variables (so they don't have to be hardcoded in the unit tests).

```
# export TRAACKR_API_KEY=
# export TRAACKR_CUSTOMER_KEY=

```

Run the entire test suite:

```
./bin/phpunit test

```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance69

Regular maintenance activity

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~75 days

Recently: every ~17 days

Total

60

Last Release

109d ago

Major Versions

0.53.0 → 1.0.02026-01-05

PHP version history (4 changes)0.0PHP &gt;=5.2

0.16PHP &gt;=5.5

1.0.0PHP &gt;=7.4

1.0.1PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/696635?v=4)[David Chancogne](/maintainers/dchancogne)[@dchancogne](https://github.com/dchancogne)

---

Top Contributors

[![dchancogne](https://avatars.githubusercontent.com/u/696635?v=4)](https://github.com/dchancogne "dchancogne (83 commits)")[![rajivraman](https://avatars.githubusercontent.com/u/2066344?v=4)](https://github.com/rajivraman "rajivraman (42 commits)")[![eculasso](https://avatars.githubusercontent.com/u/241194373?v=4)](https://github.com/eculasso "eculasso (35 commits)")[![tyrantkhan](https://avatars.githubusercontent.com/u/107844?v=4)](https://github.com/tyrantkhan "tyrantkhan (25 commits)")[![emravera](https://avatars.githubusercontent.com/u/4635107?v=4)](https://github.com/emravera "emravera (7 commits)")[![sprak3000](https://avatars.githubusercontent.com/u/5545555?v=4)](https://github.com/sprak3000 "sprak3000 (7 commits)")[![jec3](https://avatars.githubusercontent.com/u/6944267?v=4)](https://github.com/jec3 "jec3 (4 commits)")[![nhalle](https://avatars.githubusercontent.com/u/32886777?v=4)](https://github.com/nhalle "nhalle (3 commits)")[![mglennwithers](https://avatars.githubusercontent.com/u/18303629?v=4)](https://github.com/mglennwithers "mglennwithers (2 commits)")[![ajulca-traackr](https://avatars.githubusercontent.com/u/198655744?v=4)](https://github.com/ajulca-traackr "ajulca-traackr (2 commits)")[![ikitozen](https://avatars.githubusercontent.com/u/47467895?v=4)](https://github.com/ikitozen "ikitozen (1 commits)")

---

Tags

apitraackr

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/traackr-traackr-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/traackr-traackr-api-php/health.svg)](https://phpackages.com/packages/traackr-traackr-api-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[seatsio/seatsio-php

A PHP client for the seats.io API

17793.2k](/packages/seatsio-seatsio-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
