The Battle.net Diablo 3 API client for PHP
Kadala is a PHP 5.4+ library that allows you to easily communicate with the Battle.net Diablo 3 Web API. The library provides a simple PHP class-based interface with methods representing API data, and makes use of features such as compression and caching to optimize your requests.
Features
- All Diablo 3 API methods implemented
-
Simple
Client->getData()
interface, returningjson_decode()
responses - Gzip compression enabled by default
- Cache support for faster requests and responses
- 100% code coverage through unit tests and mutation testing
It is extremely easy to use:
// create a Client
$apiKey = 'my-bnet-api-key';
$client = new \Kadala\Client($apiKey, \Kadala\Region::US);
// retrieve the item data
$itemId = 'P1_CruShield_norm_unique_02';
$data = $client->getItem($itemId);
// $data contains the json_decode() response from battle.net api
Installing via Composer
The recommended way to install Kadala is through Composer.
# Install Composer
curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version:
composer.phar require kadala/kadala
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Implementation Status
As of May 3, 2015
D3 Community API
- /d3/profile/:battletag/
- /d3/profile/:battletag/hero/:id
- /d3/data/item/:data
- /d3/data/follower/:follower
- /d3/data/artisan/:artisan
Documentation
Learn how to use Kadala in our User Manual.
Releases
The latest release is Advanced Options 0.3.0 (Release Notes) on Friday, May 15, 2015.
- Guzzle options can now be passed per request. See advanced options for details.
-
If you pass a
If-Modified-Since
header option, we will returnfalse
if we do not additionally have a cache hit. See advanced options for details. All responses now have a
api
key containingregion
,locale
,retrieved
UTC date, andlastModified
UTC date if returned from the API.BC BREAK: Previous advanced region and locale settings have been moved into the options array. See advanced options for details.
See Releases for older releases.
Issues
Bug reports and feature requests can be submitted using the Github Issue Tracker.
Support Me
Hi, I'm Finlay Beaton (@ofbeaton). This software is only made possible by donations of fellow users like you, encouraging me to toil the midnight hours away and sweat into the code and documentation. Everyone's time should be valuable, please seriously consider donating.
Website Paypal Donate Button | Paypal Email Money Form
License
This software is distributed under the MIT License. Please see License file for more information.
This library is a fork of the wonderful Battle.net API Client project by Jonas Stendahl. See Fork release for more details.
Battle.net and Diablo are copyrighted by Blizzard Entertainment, Inc.
This library is neither endorsed by nor associated with Blizzard Entertainment, Inc.