PHPackages                             tustin/cod-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. tustin/cod-php

ActiveLibrary[API Development](/categories/api)

tustin/cod-php
==============

PHP API wrapper for the Call of Duty API.

1.0(7y ago)11.3k2[2 issues](https://github.com/Tustin/cod-php/issues)MITPHPPHP ^7.2

Since Nov 26Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Tustin/cod-php)[ Packagist](https://packagist.org/packages/tustin/cod-php)[ RSS](/packages/tustin-cod-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Call of Duty API Wrapper
========================

[](#call-of-duty-api-wrapper)

An API wrapper for Call of Duty's Companion App API.

Usage
=====

[](#usage)

Follow the code examples below to piece together a working example of how to use this library.

Login
-----

[](#login)

```
use CallOfDuty\Client;

$client = new Client();
// Use Activision email and password to login.
$client->login('me@email.com', 'pa55w0rd');
```

Setup User
----------

[](#setup-user)

```
// Username and platform the user plays on.
$user = $client->user('tustin25', 'psn');
```

Black Ops 4
-----------

[](#black-ops-4)

```
$bo4 = $user->blackOps4();
// Or alternatively
$bo4 = $user->bo4(); // Alias of blackOps4()
```

### Blackout

[](#blackout)

todo

### Multiplayer

[](#multiplayer)

todo

### Zombies

[](#zombies)

```
$zm = $bo4->zombies();

// Spit out some user information
echo sprintf("Prestige %d, level %d\n", $zm->prestige(), $zm->level());
echo sprintf("\tKills - %d\n", $zm->lifetime()->kills());
echo sprintf("\tDowns - %d\n", $zm->lifetime()->downs());
echo sprintf("\tHeadshots - %d\n", $zm->lifetime()->headshots());
```

WWII
----

[](#wwii)

todo

Full code example
-----------------

[](#full-code-example)

```
