Skip to content

sniffingpickles/Blizzard-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blizzard-API

Installation

First, you need to install the library. For this, use Composer: composer require ardralik/blizzard-api

Getting started

First, you need to init the Client which is used by all Blizzard APIs:

// I assume you have included Composer autoloader

$client = new \Ardralik\API\Blizzard\Client("clientId", "clientSecret", "returnUri");
Parameter Type Description
clientId string Your Blizzard App public key
clientSecret string Your Blizzard App secret key
returnUri string The value you have set in your Blizzard App settings

World of Warcraft API

First, init the WoW class. It uses the Client object previously created:

$wow = new \Ardralik\API\Blizzard\WoW($client);

Then, call the get method:

$wow->get("ressource", "data");
Parameter Type Description
ressource string The ressource you want to retrieve
data array Params required by the ressource

Here is data structure depending on ressource:

Ressource 'data' keys (type) Details
achievement id (int)
auction realm (string)
boss id (int) Can be blank to get all bosses. 'data' is not required in this case.
challenge realm (string) Can be blank to get all realms of the region. 'data' is not required in this case.
character realm (string)
name (string)
fields (array) Example:
["achievements", "mounts"]
Not required to get basic info.
guild realm (string)
name (string)
fields (array) Example:
["members"]
Not required to get basic info.
item id (int)
item_set id (int)
mount *None*
pet details (string) 'data' is not required to get a list of all pets.

If used, available values are:
  • ability
  • species
  • stats
id (int) Required only if 'type' key used.
pvp format (string) Available values:
  • 2v2
  • 3v3
  • 5v5
  • rbg
quest id (int)
realm
recipe id (int)
spell id (int)
zone id (int) Can be blank for all zones. 'data' not required in this case.
data type (string) Available values:
  • battlegroups
  • races
  • classes
  • achievements
  • guild_rewards
  • guild_perks
  • guild_achievements
  • item_classes
  • talents
  • pet_types
gameData data (string) Available balues :
  • achievementCategory
  • achievement
  • achievementMedia
  • connectedRealm
  • creatureFamily
  • creatureType
  • creature
  • creatureDisplayMedia
  • creatureFamilyMedia
  • guild
  • guildAchievements
  • guildRoster
  • guildCrest
  • guildCrestBorder
  • guildCrestEmblem
  • mythicAffix
  • mythicRaid
  • mythicKeystone
  • mythicKeystoneDungeon
  • mythicKeystonePeriod
  • mythicKeystoneSeason
  • mythicLeaderboard
  • pet
  • class
  • classPvP
  • specialization
  • powerType
  • PvPSeason
  • PvPLeaderboard
  • PvPRewards
  • PvPTier
  • PvPTierMedia
  • realms
  • region
  • token

Additional values when using gameData:

'gameData' value 'data' key Optional/Required
achievementCategory id (int) Optional
achievement id (int) Optional
achievementMedia id (int) Required
connectedRealm id (int) Optional
creatureFamily id (int) Optional
creatureType id (int) Optional
creature id (int) Required
creatureDisplayMedia id (int) Required
creatureFamilyMedia id (int) Required
guild realm (string) Required
name (string) Required
guildAchievements realm (string) Required
name (string) Required
guildRoster realm (string) Required
name (string) Required
guildCrestBorder id (int) Required
guildCrestEmblem id (int) Required
mythicAffix id (int) Optional
mythicRaid raid (string) Required
faction (string) Required
mythicKeystoneDungeon id (int) Optional
mythicKeystonePeriod id (int) Optional
mythicKeystoneSeason id (int) Optional
mythicLeaderboard id (int) Required (connected-realm ID)
dungeon (int) Optional
period (int) Required (only if 'dungeon' is used)
pet id (int) Optional
class id (int) Optional
classPvP id (int) Required
specialization id (int) Optional
powerType id (int) Optional
PvPSeason id (int) Optional
PvPLeaderboard id (int) Required
bracket (string) Optional
PvPRewards id (int) Required
PvPTier id (int) Optional
PvPTierMedia id (int) Optional
realms slug (string) Optional
region id (int) Optional

Diablo III API

First, init the Diablo class. It uses the Client object previously created:

$diablo = new \Ardralik\API\Blizzard\Diablo($client);

Then, call the get method:

$wow->diablo("ressource", "data");
Parameter Type Description
ressource string The ressource you want to retrieve
data array Params required by the ressource

Here is data structure depending on ressource:

Ressource 'data' keys (type) Details
act id (int) Not required. 'data' not required in this case.
artisan_recipe artisan (string)
recipe (string) Optional
follower slug (string)
class_skill hero (string)
skill (string) Not required. 'data' not required in this case.
item_type type (string) Not required. 'data' not required in this case.
item slug (string)
profile battleTag (string)
hero (int) ID of the hero
field (string) Available values:
  • items
  • follower-items

Oauth API

First, init the Oauth class. It uses the Client object previously created:

$oauth = new \Ardralik\API\Blizzard\Oauth($client);

Then, call the get method:

$wow->oauth("ressource", "data");
Parameter Type Description
ressource string The ressource you want to retrieve
data array Params required by the ressource

Here is data structure depending on ressource:

Ressource 'data' keys (type) Details
link scope (string) Available values:
  • wow.profile
  • sc2.profile
state (string)
token scope (string) The same used previously via 'link'
code (string)
characters token (string)
check_token token (string)

About

A PHP-written library to access Blizzard APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages