PHPackages                             mrcorex/battlenet-api - 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. mrcorex/battlenet-api

ActiveLibrary[API Development](/categories/api)

mrcorex/battlenet-api
=====================

php api for Battle.net game APIs ( https://dev.battle.net/ ).

1.4.0(10y ago)01211MITPHPPHP &gt;=5.4

Since Apr 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mrcorex/battlenet-api)[ Packagist](https://packagist.org/packages/mrcorex/battlenet-api)[ RSS](/packages/mrcorex-battlenet-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

battlenet-api
=============

[](#battlenet-api)

php api for Battle.net game APIs (  )

- Cache built in.

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

[](#installation)

Add `"mrcorex/battlenet-api": "^1"` to your composer.json file and run "composer update".

Setting configuration.
----------------------

[](#setting-configuration)

Set key, server and locale.

```
\BattleNet\Config::setApiKey($key);
\BattleNet\Config::setServer(\BattleNet\Server::EU);
\BattleNet\Config::setLocale(\BattleNet\Locale::EN_GB);
```

To enable and use cache, specify path where to store cache-files (json).

```
\BattleNet\Config::setCachePath('/path/to/my/cache');
```

Warcraft.
---------

[](#warcraft)

#### Example of getting character races.

[](#example-of-getting-character-races)

```
$data = new \BattleNet\Warcraft\Data();
$characterRaces = $data->getCharacterRaces();
```

Diablo.
-------

[](#diablo)

#### Example of getting data for blacksmith.

[](#example-of-getting-data-for-blacksmith)

```
$data = new \BattleNet\Diablo\Data();
$blacksmith = $data->getArtisanBlacksmith();
```

StarCraft.
----------

[](#starcraft)

#### Example of getting data for rewards.

[](#example-of-getting-data-for-rewards)

```
$data = new \BattleNet\StarCraft\Data();
$rewards = $data->getRewards();
```

Clearing cache.
---------------

[](#clearing-cache)

```
\BattleNet\Config::clearCache('wow');
```

Notice that you need to specify "wow", "sc2" and "d3" to clear cache for specific game.

TODO
----

[](#todo)

- Add media-links for various thumbnails, icons etc.
- Add support for Auth.

ChangeLog
---------

[](#changelog)

- 2016-04-02 1.0.0 Initial development.
- 2016-04-02 1.1.0 Added support for StarCraft.
- 2016-04-02 1.1.1 Added getMatches() for StarCraft.
- 2016-04-02 1.2.0 Added support for Diablo.
- 2016-04-02 1.3.0 Added support for changing cache-lifetime (short/long).
- 2016-04-02 1.4.0 Refactored cache handler for general usage.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~0 days

Total

6

Last Release

3689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a6aef84926b0714b13d3245e2fa5aa650fd48d896936f6f2841e88c0b960780?d=identicon)[mrcorex](/maintainers/mrcorex)

---

Top Contributors

[![corex](https://avatars.githubusercontent.com/u/21259173?v=4)](https://github.com/corex "corex (18 commits)")[![mrcorex](https://avatars.githubusercontent.com/u/570804?v=4)](https://github.com/mrcorex "mrcorex (1 commits)")

---

Tags

wowdiablobattle.netbattleblizzardstarcraft

### Embed Badge

![Health badge](/badges/mrcorex-battlenet-api/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[logansua/blizzard-api-client

API client for blizzard API written in PHP

302.5k](/packages/logansua-blizzard-api-client)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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