PHPackages                             jpikowski/criteo-mapi-php-client - 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. jpikowski/criteo-mapi-php-client

Abandoned → [criteo/criteo-php-marketing-sdk](/?search=criteo%2Fcriteo-php-marketing-sdk)Library[API Development](/categories/api)

jpikowski/criteo-mapi-php-client
================================

A PHP Client For Criteo MAPI Requests

1.0.0(7y ago)019MITPHPPHP &gt;=7.2

Since Feb 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/joepikowski/criteo-mapi-php-client)[ Packagist](https://packagist.org/packages/jpikowski/criteo-mapi-php-client)[ Docs](https://github.com/joepikowski/criteo-mapi-php-client)[ RSS](/packages/jpikowski-criteo-mapi-php-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Criteo PHP MAPI Client
======================

[](#criteo-php-mapi-client)

### Features

[](#features)

- Authentication retry system
- Inline code documentation
- Save reporting results to file

### Installation

[](#installation)

The Criteo MAPI package can be installed via Composer:

```
composer require jpikowski/criteo-mapi-php-client:"^1.0"
```

Once installed, make sure your dependencies are included via the autoloader:

```
require_once __DIR__ . 'vendor/autoload.php';
```

### Basic Code Examples

[](#basic-code-examples)

##### Initialization

[](#initialization)

```
require_once __DIR__ . 'vendor/autoload.php'; //Composer Dependencies

$criteo = new Criteo_MAPI( 'username', 'password' );
```

##### A Basic Request

[](#a-basic-request)

Results from an API request are returned as an associative array of results.

```
$criteo->getCampaignsByAdvertiser( '12345' );
```

### Authentication Retry

[](#authentication-retry)

Oauth2 Tokens retrieved from the `/oauth2/token` endpoint are valid for 5 minutes.

For the first request after initialization, the MAPI Client will request an authentication token based on the username and password provided and proceed with the request.

##### First Request (No Stored Auth)

[](#first-request-no-stored-auth)

[![MAPI Authentication Retry](https://camo.githubusercontent.com/b9bf818207c5f121ece7b692166578b67a9b49bbbaa38393112bf396ed28e2e6/687474703a2f2f63726974656f2e776f726b2f6d6170692f696d672f6d6170692d312e706e67)](https://camo.githubusercontent.com/b9bf818207c5f121ece7b692166578b67a9b49bbbaa38393112bf396ed28e2e6/687474703a2f2f63726974656f2e776f726b2f6d6170692f696d672f6d6170692d312e706e67)

For subsequent requests, the stored token may have become invalid for long-running processes. The MAPI Client will automatically detect the need for a refreshed token and retry a request that fails once because of a `401 Unauthorized` error.

##### Request with Expired or Invalid Token

[](#request-with-expired-or-invalid-token)

[![MAPI Authentication Retry](https://camo.githubusercontent.com/fd00838c36f6f6607da24cb2fd7a7669c1a27b928f990213b35c9e052572c5f2/687474703a2f2f63726974656f2e776f726b2f6d6170692f696d672f6d6170692d322e706e67)](https://camo.githubusercontent.com/fd00838c36f6f6607da24cb2fd7a7669c1a27b928f990213b35c9e052572c5f2/687474703a2f2f63726974656f2e776f726b2f6d6170692f696d672f6d6170692d322e706e67)

### Other Features

[](#other-features)

##### Saving Reports to File

[](#saving-reports-to-file)

For reporting API calls, a filepath can be provided to optionally save results to a local path.

```
	$query = [
		'reportType' => 'CampaignPerformance',
		'advertiserIds' => '12345',
		'startDate' => '2019-01-15',
		'endDate' => '2019-01-16',
		'dimensions' => [
			'CampaignId',
			'AdvertiserId',
			'Day'
		],
		'metrics' => [
			'Clicks',
			'Displays'
		],
		'format' => 'csv',
		'currency' => 'USD',
		'timezone' => 'PST'
	];

$criteo->getStats($query, './reports/results.csv');
```

### Further Documentation

[](#further-documentation)

[MAPI Documentation (Criteo Help Center)](https://support.criteo.com/hc/en-us/sections/360000221105-Criteo-Marketing-API-)

[MAPI Spec and Test Tool (Swagger)](https://api.criteo.com/marketing/swagger/ui/index#/)

### License

[](#license)

[MIT](MIT-LICENSE)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2694d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5891695?v=4)[Joe Pikowski](/maintainers/joepikowski)[@joepikowski](https://github.com/joepikowski)

---

Tags

criteomapi

### Embed Badge

![Health badge](/badges/jpikowski-criteo-mapi-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/jpikowski-criteo-mapi-php-client/health.svg)](https://phpackages.com/packages/jpikowski-criteo-mapi-php-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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