PHPackages                             dant89/smite-api-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. dant89/smite-api-php-client

ActiveLibrary

dant89/smite-api-php-client
===========================

A lightweight PHP client for Smite API

1.2.0(6y ago)0581MITPHPCI failing

Since Oct 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/dant89/smite-api-php-client)[ Packagist](https://packagist.org/packages/dant89/smite-api-php-client)[ RSS](/packages/dant89-smite-api-php-client/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (4)Versions (8)Used By (0)

[![Smite logo](https://github.com/dant89/smite-stats/raw/master/public/images/LOGO_SMITE_2016_Blktagline_Shadow_500x170.png)](https://github.com/dant89/smite-stats/blob/master/public/images/LOGO_SMITE_2016_Blktagline_Shadow_500x170.png)

Smite API PHP Client
====================

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

[![Latest Stable Version](https://camo.githubusercontent.com/dd868df0a6d0a01c6dfe0f3a6017b2aca9b432b1488999c3088b29704e662e06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e7438392f736d6974652d6170692d7068702d636c69656e742e737667)](https://packagist.org/packages/dant89/smite-api-php-client)[![Github Issues](https://camo.githubusercontent.com/4b8fe11c1305799c2bbd10fd038519427ff51d722acbc3147a7c3279d3c5e4d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f64616e7438392f736d6974652d6170692d7068702d636c69656e74)](https://github.com/dant89/smite-api-php-client/issues)

A lightweight PHP client for the Smite developer API.

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

[](#installation)

To install, run `composer require dant89/smite-api-php-client` in the root of your project or add `dant89/smite-api-php-client` to your composer.json.

```
"require": {
    "dant89/smite-api-php-client": REPLACE_WITH_VERSION
}
```

Smite developer API Documentation
---------------------------------

[](#smite-developer-api-documentation)

To read more about how the Smite developer API functions, please read the [official documentation](https://docs.google.com/document/d/1OFS-3ocSx-1Rvg4afAnEHlT3917MAK_6eJTR6rzr-BM/).

Smite developer API Access
--------------------------

[](#smite-developer-api-access)

The Smite developer API requires that you first complete [this form](https://fs12.formsite.com/HiRez/form48/secure_index.html) to apply for credentials.

> If your application is accepted you will receive custom credentials to access the API.
>
> - Smite

Usage
-----

[](#usage)

Use your provided `DevId` and `AuthKey` upon instantiation of this client.

```
use Dant89\SmiteApiClient\Client;

// Create base client
$smiteClient = new Client(SMITE_DEV_ID, SMITE_AUTH_KEY);
```

> To begin using the API, you will first need to establish a valid Session. To do so you will start a session (via the createsession method) and receive a SessionId. Sessions are used for authentication, security, monitoring, and throttling. Once you obtain a SessionId, you will pass it to other methods for authentication. Each session only lasts for 15 minutes and must be recreated afterward.
>
> - Smite

```
// Get a session_id from a signed authentication request
$authClient = $smiteClient->getHttpClient('auth');
$timestamp = date('omdHis');
$response = $authClient->createSession($timestamp);

// Check for valid response status
if ($response->getStatus() === 200) {
    $sessionId = $response->getContent()['session_id'];
}
```

Now that you have a `$sessionId` you are free to make calls to the other client methods. This client takes care of signing the requests so you don't need to worry about that and can now make calls to other methods, for example to get a teams (clans) players, you would use:

```
$clanId = 123;

$teamClient = $smiteClient->getHttpClient('team');
$response = $teamClient->getTeamPlayers($clanId, $sessionId, $timestamp);

$teamPlayers = [];
if ($response->getStatus() === 200) {
    $teamPlayers = $response->getContent();
}
```

Rate Limiting / Caching Suggestion
----------------------------------

[](#rate-limiting--caching-suggestion)

I recommend that you implement some sort of caching of your `$sessionId` and / or returned data, the Smite developer API has rate limits so caching will help you avoid going over those limits:

Default limits:

> concurrent\_sessions: 50
> sessions\_per\_day: 500
> session\_time\_limit: 15 minutes
> request\_day\_limit: 7500

Helpers
-------

[](#helpers)

`languageCode` values:

- `1` English
- `2` German
- `3` French
- `5` Chinese
- `7` Spanish
- `9` Spanish (Latin America)
- `10` Portuguese
- `11` Russian
- `12` Polish
- `13` Turkish

Tests
-----

[](#tests)

You can test your API key by running the PHPUnit tests included in this client.

At present there is no rate limiting or caching so a run through will use 7 of your daily sessions (this is not ideal).

PHPUnit tests:

1. Add your `devId` and `authKey` to `tests/Helper/ClientTestCase.php`
2. `php vendor/phpunit/phpunit/phpunit tests`

PHP CodeSniffer:

- `php vendor/squizlabs/php_codesniffer/bin/phpcs src --standard=PSR2 --severity=5 --extensions=php`

PHP MessDetector

- `php vendor/phpmd/phpmd/src/bin/phpmd src text controversial,unusedcode,design `

Contributions
-------------

[](#contributions)

Contributions to the client are welcome, to contribute please:

1. Fork this repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a new pull request

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance58

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

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 ~36 days

Total

5

Last Release

2262d ago

Major Versions

0.0.2 → 1.0.02019-10-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/09e9dab2a010158a6b2a381ba3f41f3f30887305090f40b4b667803d9986483d?d=identicon)[dant89](/maintainers/dant89)

---

Top Contributors

[![dant89](https://avatars.githubusercontent.com/u/1819818?v=4)](https://github.com/dant89 "dant89 (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dant89-smite-api-php-client/health.svg)

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

###  Alternatives

[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32902.4k](/packages/acquia-orca)[mahocommerce/maho

Free and open source ecommerce platform, created in 2024 on the M1 platform, PHP 8.3+

1322.1k12](/packages/mahocommerce-maho)

PHPackages © 2026

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