PHP wrapper for the Guild Wars 2 API.
composer require gw2treasures/gw2api
If you haven't included composers autoloader yet, you will have to add this before being able to use the GW2 API Wrapper.
include 'vendor/autoload.php';
You need to download the latest gw2api.phar and the guzzle.phar of the latest 7.x version of the guzzle library and place both files in your project directory. Now you can include both files to start using the GW2 API wrapper.
include __DIR__ . '/gw2api.phar';
include __DIR__ . '/guzzle.phar';
// create new api instance
$api = new \GW2Treasures\GW2Api\GW2Api();
// get all worlds
$worlds = $api->worlds()->all();
// get some happy quaggans
$quaggans = $api->quaggans()->many([ 'cheer', 'party' ]);
// get item details in german
$ektoplasmakugel = $api->items()->lang('de')->get(19721);
// search recipes
$recipes = $api->recipes()->search()->input(46746);
// get all character names
$characters = $api->characters('api_key')->ids();
// get 10 recently bought items
$recentlyBought = $api->commerce()->transactions('api_key')->history()->buys()->page(0, 10);
For all examples it is assumed that you have a variable $api = new GW2Api()
.
API Endpoint | Class† Instance |
Flags‡ | |
---|---|---|---|
/v2/account | Account\AccountEndpoint GW2Api::account() |
🔒 | |
/v2/account/achievements | Account\AchievementEndpoint GW2Api::account()->achievement() |
🔒 | |
/v2/account/bank | Account\BankEndpoint GW2Api::account()->bank() |
🔒 | |
/v2/account/dyes | Account\DyeEndpoint GW2Api::account()->dyes() |
🔒 | |
/v2/account/finishers | Account\FinisherEndpoint GW2Api::account()->finishers() |
🔒 | |
/v2/account/inventory | Account\InventoryEndpoint GW2Api::account()->inventory() |
🔒 | |
/v2/account/masteries | Account\MasteryEndpoint GW2Api::account()->masteries() |
🔒 | |
/v2/account/materials | Account\MaterialEndpoint GW2Api::account()->materials() |
🔒 | |
/v2/account/minis | Account\MiniEndpoint GW2Api::account()->minis() |
🔒 | |
/v2/account/recipes | Account\RecipeEndpoint GW2Api::account()->recipes() |
🔒 | |
/v2/account/skins | Account\SkinEndpoint GW2Api::account()->skins() |
🔒 | |
/v2/account/titles | Account\TitleEndpoint GW2Api::account()->titles() |
🔒 | |
/v2/account/wallet | Account\WalletEndpoint GW2Api::account()->wallet() |
🔒 | |
/v2/achievements | Achievement\AchievementEndpoint GW2Api::achievements() |
📦🌏 | |
/v2/achievements/categories | Achievement\CategoryEndpointGW2Api::achievements()->categories() |
📦🌏 | |
/v2/achievements/daily | Achievement\DailyEndpoint GW2Api::achievements()->daily() |
||
/v2/achievements/daily/tomorrow | Achievement\DailyTomorrowEndpoint GW2Api::achievements()->daily()->tomorrow() |
||
/v2/achievements/groups | Achievement\GroupEndpoint GW2Api::achievements()->groups() |
📦🌏 | |
/v2/backstory/answers | Backstory\AnswerEndpoint GW2Api::backstory()->answers() |
📦🌏 | |
/v2/backstory/questions | Backstory\QuestionEndpoint GW2Api::backstory()->questions() |
📦🌏 | |
/v2/build | Build\BuildEndpoint GW2Api::build() |
||
/v2/characters | Character\CharacterEndpoint GW2Api::characters() |
🔒📦 | |
/v2/characters/:id/backstory | Character\BackstoryEndpoint GW2Api::characters()->backstoryOf() |
🔒 | |
/v2/characters/:id/core | Character\CoreEndpoint GW2Api::characters()->coreOf() |
🔒 | |
/v2/characters/:id/crafting | Character\CraftingEndpoint GW2Api::characters()->craftingOf() |
🔒 | |
/v2/characters/:id/equipment | Character\EquipmentEndpoint GW2Api::characters()->equipmentOf() |
🔒 | |
/v2/characters/:id/heropoints | Character\HeropointEndpoint GW2Api::characters()->heropointsOf() |
🔒 | |
/v2/characters/:id/inventory | Character\InventoryEndpoint GW2Api::characters()->inventoryOf() |
🔒 | |
/v2/characters/:id/recipes | Character\RecipeEndpoint GW2Api::characters()->recipesOf() |
🔒 | |
/v2/characters/:id/skills | Character\SkillEndpoint GW2Api::characters()->skillsOf() |
🔒 | |
/v2/characters/:id/specializations | Character\SpecializationEndpoint GW2Api::characters()->specializationsOf() |
🔒 | |
/v2/characters/:id/training | Character\TrainingEndpoint GW2Api::characters()->trainingOf() |
🔒 | |
/v2/colors | Color\ColorEndpoint GW2Api::colors() |
📦🌏 | |
/v2/commerce/exchange | Commerce\ExchangeEndpoint GW2Api::commerce()->exchange() |
||
/v2/commerce/listings | Commerce\ListingEndpoint GW2Api::commerce()->listings() |
📦 | |
/v2/commerce/prices | Commerce\PriceEndpoint GW2Api::commerce()->prices() |
📦 | |
/v2/commerce/transactions | Commerce\Transaction\TransactionEndpoint GW2Api::commerce()->transactions() |
🔒📄 | |
/v2/continents | Continent\ContinentEndpoint GW2Api::continents() |
📦🌏 | |
/v2/currencies | Currency\CurrencyEndpoint GW2Api::currencies() |
📦🌏 | |
/v2/novelties | Novelty\NoveltyEndpoint GW2Api::novelties() |
📦🌏 | |
/v2/emblem | Emblem\EmblemEndpoint GW2Api::emblem() |
||
disabled | 🌏🚫 | ||
disabled | 🚫 | ||
/v2/files | File\FileEndpoint GW2Api::files() |
📦 | |
/v2/finishers | Finisher\FinisherEndpoint GW2Api::finishers() |
📦🌏 | |
/v2/guild/:id | Guild\DetailsEndpoint GW2Api::guild()->detailsOf() |
🔓 | 🚫 |
/v2/guild/:id/log | Guild\Authenticated\LogEndpoint GW2Api::guild()->logOf() |
🔒 | |
/v2/guild/:id/members | Guild\Authenticated\MemberEndpoint GW2Api::guild()->membersOf() |
🔒 | |
/v2/guild/:id/ranks | Guild\Authenticated\RankEndpoint GW2Api::guild()->ranksOf() |
🔒 | |
/v2/guild/:id/stash | Guild\Authenticated\StashEndpoint GW2Api::guild()->stashOf() |
🔒 | |
/v2/guild/:id/teams | Guild\Authenticated\TeamEndpoint GW2Api::guild()->teamsOf() |
🔒 | |
/v2/guild/:id/treasury | Guild\Authenticated\TreasuryEndpoint GW2Api::guild()->treasuryOf() |
🔒 | |
/v2/guild/:id/upgrades | Guild\Authenticated\UpgradeEndpoint GW2Api::guild()->upgradesOf() |
🔒 | |
/v2/guild/permissions | Guild\PermissionEndpoint GW2Api::guild()->permissionsOf() |
📦🌏 | |
/v2/guild/upgrades | Guild\UpgradeEndpoint GW2Api::guild()->upgradesOf() |
📦🌏 | |
/v2/home/cats | Home\CatEndpoint GW2Api::home()->cats() |
📦 | |
/v2/home/nodes | Home\NodeEndpoint GW2Api::home()->nodes() |
📦 | |
/v2/items | Item\ItemEndpoint GW2Api::items() |
📦🌏 | |
/v2/itemstats | Itemstat\ItemstatEndpoint GW2Api::itemstats() |
📦🌏 | |
disabled | 🚫 | ||
/v2/legends | Legend\LegendEndpoint GW2Api::legends() |
📦🌏 | |
/v2/maps | Map\MapEndpoint GW2Api::maps() |
📦🌏 | |
/v2/masteries | Mastery\MasteryEndpoint GW2Api::masteries() |
📦🌏 | |
/v2/materials | Material\MaterialEndpoint GW2Api::materials() |
📦🌏 | |
/v2/minis | Mini\MiniEndpoint GW2Api::minis() |
📦🌏 | |
/v2/mounts/types | Mount\TypeEndpoint GW2Api::mounts()->types() |
📦🌏 | |
/v2/mounts/skins | Mount\SkinEndpoint GW2Api::mounts()->skins() |
📦🌏 | |
/v2/novelties | Novelty\NoveltyEndpoint GW2Api::novelties() |
📦🌏 | |
/v2/outfits | Outfit\OutfitEndpoint GW2Api::outfits() |
📦🌏 | |
/v2/pets | Pet\PetEndpoint GW2Api::pets() |
📦🌏 | |
/v2/profession | Profession\ProfessionEndpoint GW2Api::professions() |
📦🌏 | |
/v2/pvp/amulets | Pvp\AmuletEndpoint GW2Api::pvp()->amulets() |
📦🌏 | |
/v2/pvp/games | Pvp\GameEndpoint GW2Api::pvp()->games() |
🔒📦 | |
/v2/pvp/seasons | Pvp\SeasonEndpoint GW2Api::pvp()->seasons() |
📦🌏 | |
/v2/pvp/standings | Pvp\StandingEndpoint GW2Api::pvp()->standings() |
🔒 | |
/v2/pvp/stats | Pvp\StatsEndpoint GW2Api::pvp()->stats() |
🔒 | |
/v2/quaggans | Quaggan\QuagganEndpoint GW2Api::quaggans() |
📦 | |
/v2/recipes | Recipe\RecipeEndpoint GW2Api::recipes() |
📦 | |
/v2/recipes/search | Recipe\SearchEndpoint GW2Api::recipes()->search() |
||
/v2/skills | Skill\SkillEndpoint GW2Api::skills() |
📦🌏 | |
/v2/skins | Skin\SkinEndpoint GW2Api::skins() |
📦🌏 | |
/v2/specializations | Specialization\SpecializationEndpoint GW2Api::specializations() |
📦🌏 | |
/v2/stories | Story\StoryEndpoint GW2Api::stories() |
📦🌏 | |
/v2/stories/seasons | Story\SeasonEndpoint GW2Api::stories()->season |
📦🌏 | |
/v2/titles | Title\TitleEndpoint GW2Api::titles() |
📦🌏 | |
/v2/tokeninfo | Tokeninfo\TokeninfoEndpoint GW2Api::tokeninfo() |
🔒 | |
/v2/traits | Traits\TraitEndpoint GW2Api::traits() |
📦🌏 | |
/v2/worlds | World\WorldEndpoint GW2Api::worlds() |
📦🌏 | |
/v2/wvw/abilities | WvW\AbilityEndpoint GW2Api::wvw()->abilities() |
📦🌏 | |
/v2/wvw/matches | WvW\MatchEndpoint GW2Api::wvw()->matches() |
📦 | |
/v2/wvw/objectives | WvW\ObjectiveEndpoint GW2Api::wvw()->objectives() |
📦🌏 |
† Not FQN, all endpoints are in the namespace \GW2Treasures\GW2Api\V2\Endpoint
‡ Flags:
🔒AuthenticatedEndpoint
📦BulkEndpoint
🌏LocalizedEndpoint
📄PaginatedEndpoint
🚫Disabled in the API
\GW2Treasures\GW2Api\V2\Authentication\IAuthenticatedEndpoint
(source)
All endpoints requiring authentication implement the interface IAuthenticatedEndpoint
.
Throws AuthenticationException
and InvalidPermissionsException.
\GW2Treasures\GW2Api\V2\Bulk\IBulkEndpoint
(source)
All endpoints supporting bulk expansion implement the interface IBulkEndpoint
.
Extends PaginatedEndpoint.
Throws PageOutOfRangeException.
all():array
Get all entries.?ids=all
this falls back to PaginatedEndpoint::all()
.ids():int[]|string[]
Get all ids.get(int|string $id):mixed
Get a single entry by id.many(int[]|string[] $ids):array
Get multiple entries by id.IPaginatedEndpoint::page(int $page, [int $size]):array
Get a specific page of the endpoint.IPaginatedEndpoint::batch([int $parallelRequests], Closure $callback):void
Get all entries in multiple small batches. The callback gets called with new entries until all entries have been processed.function(array $entries):void
.$api->items()->all();
// => returns array with all items
$api->items()->ids();
// => returns array with all item ids
$api->items()->get(1);
// => returns item with id 1
$api->items()->many([1,2,3]);
// => returns items with ids 1, 2 and 3
\GW2Treasures\GW2Api\V2\Localization\ILocalizedEndpoint
(source)
All endpoints supporting localization implement the interface ILocalizedEndpoint
.
Defaults to en
.
Throws InvalidLanguageException.
lang(string $lang):$this
Change the language of the endpoint.$api->items()->lang('de')->get(1)
// => returns german item 1
\GW2Treasures\GW2Api\V2\Pagination\IPaginatedEndpoint
(source)
All endpoints supporting pagination implement the interface IPaginatedEndpoint
.
Throws PageOutOfRangeException.
all():array
Get all entries.page(int $page, [int $size]):array
Get a page of entries.
The $size
defaults to the maximum page size (200 for most endpoints).batch([int $parallelRequests], Closure $callback):void
Get all entries in multiple small batches. The callback gets called with new entries until all entries have been processed.function(array $entries):void
.$api->items()->all();
// => returns all items
$api->items()->page(0, 10);
// => returns first page of 10 items
$api->items()->batch(function($items) {
// $items contains items of current batch.
// gets called multiple times with different items untill all items have been processed.
});
\GW2Treasures\GW2Api\V2\Endpoint\Guild\IRestrictedGuildEndpoint
(source)
All guild endpoints requiring you to be a member implement the interface RestrictedGuildEndpoint
.
Throws GuildLeaderRequiredException or MembershipRequiredException.
\GW2Treasures\GW2Api\Exception\ApiException
(source)
Gets thrown by all endpoints when the API returns an error.
Extends \Exception
.
getResponse():ResponseInterface
The response that was returned by the API.try {
$api->items()->get('invalid item id');
} catch(ApiException $exception) {
$exception->getMessage() === "no such id"
}
\GW2Treasures\GW2Api\V2\Authentication\Exception\AuthenticationException
(source)
Gets thrown by AuthenticatedEndpoints when the endpoint needs authentication but no API key was specified or the API key was invalid. Extends ApiException.
try {
$api->account('INVALID_API_KEY')->get();
} catch(AuthenticationException $exception) {
$exception->getMessage() === "invalid key"
}
\GW2Treasures\GW2Api\V2\Authentication\Exception\InvalidPermissionsException
(source)
Gets thrown by AuthenticatedEndpoints when the API key is missing permissions to access the endpoint. Extends AuthenticationException.
getMissingScope():string
The permission that was missing to access the endpoint.try {
$api->characters('API_KEY_WITHOUT_CHARACTERS_SCOPE')->get();
} catch(InvalidPermissionsException $exception) {
$exception->getMessage() === "requires scope characters"
$exception->getMissingScope() === "characters"
}
\GW2Treasures\GW2Api\V2\Localization\Exception\InvalidLanguageException
(source)
Gets thrown by LocalizedEndpoints when the API responds with a different language than requested. Extends ApiException.
getRequestLanguage():string
The requested language.getResponseLanguage():string
The language the API responded with.try {
$api->items()->lang('invalid')->get(1);
} catch(InvalidLanguageException $exception) {
$exception->getMessage() === "Invalid language (expected: invalid; actual: en)"
$exception->getRequestLanguage() === "invalid"
$exception->getResponseLanguage() === "en"
}
\GW2Treasures\GW2Api\V2\Pagination\Exception\PageOutOfRangeException
(source)
Gets thrown by PaginatedEndpoints when requesting a page that doesn't exist. Extends ApiException.
try {
$api->items()->page(9001);
} catch(PageOutOfRangeException $exception) {
$exception->getMessage() === "page out of range. Use page values 0 - 826."
}
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Exception\GuildException
(source)
Parent class of all guild exceptions. Extends ApiException.
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Exception\GuildLeaderRequiredException
(source)
Gets thrown by RestrictedGuildEndpoint when requesting informations of a guild you are not the leader of. Extends GuildException.
try {
$api->guild()->membersOf('API_KEY', 'GUILD_ID_YOU_ARE_NOT_LEADER_OF');
} catch(GuildLeaderRequiredException $exception) {
$exception->getMessage() === "access restricted to guild leaders"
}
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Exception\GuildLeaderRequiredException
(source)
Gets thrown by RestrictedGuildEndpoint when requesting informations of a guild you are not a member of. Extends GuildException.
try {
$api->guild()->membersOf('API_KEY', 'GUILD_ID_YOU_ARE_NOT_A_MEMBER_OF');
} catch(GuildLeaderRequiredException $exception) {
$exception->getMessage() === "membership required"
}
\GW2Treasures\GW2Api\V2\Endpoint\Account\AccountEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():mixed
Get basic account info.bank():Account\BankEndpoint
Gets a new Account\BankEndpoint instance.materials():Account\MaterialEndpoint
Gets a new Account\MaterialEndpoint instance.$api->account('API_KEY')->get();
// => { id: "account-guid", name: "Lawton.1234", … }
\GW2Treasures\GW2Api\V2\Endpoint\Account\AchievementEndpoint
(source)
The AchievementEndpoint can be used to look up the achievements returned by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get account achievement progression.$api->account('API_KEY')->achievements()->get();
// => [ { id: 1, current: 1, max: 1000, done: false }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\BankEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Get account bank.$api->account('API_KEY')->bank()->get();
// => [ null, { id: 46774, slot: 1, count: 1 }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\DyeEndpoint
(source)
The ColorEndpoint can be used to look up the colors used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked dyes.$api->account('API_KEY')->dyes()->get();
// => [ 8, 12, 14, 17, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\FinisherEndpoint
(source)
The FinisherEndpoint can be used to look up the finishers used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked finishers.$api->account('API_KEY')->finishers()->get();
// => [ { id: 1, permanent: true }
\GW2Treasures\GW2Api\V2\Endpoint\Account\InventoryEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Returns a list of item stacks representing the account's shared inventory slots.$api->account('API_KEY')->inventory()->get();
// => [ null, { id: 12138, count: 250 }, null ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\MasteryEndpoint
(source)
The MasteryEndpoint can be used to get the masteries used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked masteries.$api->account('API_KEY')->masteries()->get();
// => [ { id: 4, level: 4 }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\MaterialEndpoint
(source)
The MaterialEndpoint can be used to get the categories used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get account material storage.$api->account('API_KEY')->materials()->get();
// => [ { id: 19699, category: 5, count: 250 }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\MiniEndpoint
(source)
The MiniEndpoint can be used to look up the minis returned by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked minis.$api->account('API_KEY')->minis()->get();
// => [ 1, 2, 3, 4, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\MiniEndpoint
(source)
The NoveltyEndpoint can be used to look up the minis returned by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked novelties.$api->account('API_KEY')->novelties()->get();
// => [ 1, 2, 3, 4, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\RecipeEndpoint
(source)
The RecipeEndpoint can be used to look up the recipes used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked recipes.$api->account('API_KEY')->recipes()->get();
// => [ 104, 105, 106, 107, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\SkinEndpoint
(source)
The SkinEndpoint can be used to look up the skins used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked skins.$api->account('API_KEY')->skins()->get();
// => [ 1, 2, 3, 4, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\TitleEndpoint
(source)
The TitleEndpoint can be used to look up the titles used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked titles.$api->account('API_KEY')->titles()->get();
// => [ 1, 17, 188, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Account\WalletEndpoint
(source)
The CurrencyEndpoint can be used to look up the currencies used by this endpoint. Implements 🔒AuthenticatedEndpoint.
get():array
Get the account wallet.$api->account('API_KEY')->wallet()->get();
// => [ { id: 1, value: 234885 }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Achievement\AchievementEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
categories():Achievement\CategoryEndpoint
Gets a new Achievement\CategoryEndpoint instance.daily():Achievement\DailyEndpoint
Gets a new Achievement\DailyEndpoint instance.groups():Achievement\GroupEndpoint
Gets a new Achievement\GroupEndpoint instance.$api->achievements()->get(1);
// => { id: 1, name: "Centaur Slayer", … }
\GW2Treasures\GW2Api\V2\Endpoint\Achievement\CategoryEndpoint
(source)
$api->achievements()->categories()->get(50);
// => { id: 50, name: "Twilight Assault", … }
\GW2Treasures\GW2Api\V2\Endpoint\Achievement\DailyEndpoint
(source)
get():mixed
Get the current daily achievements.tomorrow():DailyTomorrowEndpoint
Get tomorrows daily achievements.$api->achievements()->daily()->get();
// => { pve: [ { id: 1984, level: { min:1, max: 80 } }, … ], pvp: [ … ], wvw: [ … ] }
\GW2Treasures\GW2Api\V2\Endpoint\Achievement\DailyTomorrowEndpoint
(source)
get():mixed
Get the current daily achievements.$api->achievements()->daily()->tomorrow()->get();
// => { pve: [ { id: 1973, level: { min:1, max: 79 } }, … ], pvp: [ … ], wvw: [ … ] }
\GW2Treasures\GW2Api\V2\Endpoint\Achievement\GroupEndpoint
(source)
$api->achievements()->groups()->get('65B4B678-607E-4D97-B458-076C3E96A810');
// => { id: "65B4B678-607E-4D97-B458-076C3E96A810", name: "Heart of Thorns", … }
\GW2Treasures\GW2Api\V2\Endpoint\Backstory\AnswerEndpoint
(source)
$api->backstory()->answers()->get('7-54');
// => { id: "7-54", title: "Dignity", question: 7, … }
\GW2Treasures\GW2Api\V2\Endpoint\Backstory\QuestionEndpoint
(source)
$api->backstory()->questions()->get('7');
// => { id: 7, title: "My Personality", answers: [ "7-53", "7-54", "7-55" ], … }
\GW2Treasures\GW2Api\V2\Endpoint\Build\BuildEndpoint
(source)
get():int
Gets the current build id.$api->build()->get();
// => 50430
\GW2Treasures\GW2Api\V2\Endpoint\Character\CharacterEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and 📦BulkEndpoint.
equipmentOf():Character\EquipmentEndpoint
Gets a new Character\EquipmentEndpoint instance.inventoryOf():Character\InventoryEndpoint
Gets a new Character\InventoryEndpoint instance.recipesOf():Character\RecipeEndpoint
Gets a new Character\RecipeEndpoint instance.specializationsOf():Character\SpecializationEndpoint
Gets a new Character\SpecializationEndpoint instance.$api->characters('API_KEY')->get('Character Name');
// => { name: "Hello", race: "Human", … }
\GW2Treasures\GW2Api\V2\Endpoint\Character\BackstoryEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters backstory.$api->characters('API_KEY')->backstoryOf('Character Name')->get();
// => [ "26-122", "27-125", … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\CoreEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the core information of a character.$api->characters('API_KEY')->coreOf('Character Name')->get();
// => { name: "Test Char", race: "Norn", gender: "Female", … }
\GW2Treasures\GW2Api\V2\Endpoint\Character\CraftingEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Get the crafting information of a character.$api->characters('API_KEY')->craftingOf('Character Name')->get();
// => [ { discipline: "Tailor", rating: 400, active: true }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\EquipmentEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters equipment.$api->characters('API_KEY')->equipmentOf('Character Name')->get();
// => [ { id: 6472, slot: "Coat" }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\HeropointEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters heropoints.$api->characters('API_KEY')->heropointsOf('Character Name')->get();
// => [ "0-3", "0-4", "0-5", "0-6", "0-8", … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\InventoryEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters inventory.$api->characters('API_KEY')->inventoryOf('Character Name')->get();
// => [ { id: 8941, size: 4 inventory: [ null, { id: 32134, count: 1 }, … ] }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\RecipeEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Get unlocked recipes of a character.$api->characters('API_KEY')->recipesOf('Character Name')->get();
// => [ 7, 8, 9, 10, 11, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Character\SkillEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters skills.$api->characters('API_KEY')->skillsOf('Character Name')->get();
// => { pve: { heal: 5503, utilities: [ 5641, 5734, 5502 ], elite: 5666 }, … }
\GW2Treasures\GW2Api\V2\Endpoint\Character\SpecializationEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters specializations.$api->characters('API_KEY')->specializationsOf('Character Name')->get();
// => { pve: [ { id: 41, traits: [232, 214, 226] }, … ], … }
\GW2Treasures\GW2Api\V2\Endpoint\Character\TrainingEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():array
Gets the characters trainings.$api->characters('API_KEY')->trainingOf('Character Name')->get();
// => [ { id: 111, spent: 24, done: true }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Color\ColorEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->colors()->lang('de')->all();
// => [ { id: 1, name: "Farbentferner", base_rgb: [128,26,26], … }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Commerce\ExchangeEndpoint
(source)
gems(int $quantity):mixed
Current gem to coins exchange rate.coins(int $quantity):mixed
Current coins to gems exchange rate.$api->commerce()->exchange()->gems(50);
// => { coins_per_gem: 1211, quantity: 60579 }
\GW2Treasures\GW2Api\V2\Endpoint\Commerce\ListingEndpoint
(source)
Implements 📦BulkEndpoint.
$api->commerce()->listings()->get(24);
// => { id: 24, buys: [ { listings: 1, unit_price: 186, quantity: 250 }, … ] }
\GW2Treasures\GW2Api\V2\Endpoint\Commerce\PriceEndpoint
(source)
Implements 📦BulkEndpoint.
$api->commerce()->prices()->get(24);
// => { id: 24, buys: { quantity: 20854, unit_price: 186 }, sells: { quantity: 9787, unit_price: 340 } }
\GW2Treasures\GW2Api\V2\Endpoint\Commerce\Transaction\TransactionEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
current():Commerce\Transaction\TypeEndpoint
Gets a new Commerce\Transaction\TypeEndpoint instance
representing current transactions.history():Commerce\Transaction\TypeEndpoint
Gets a new Commerce\Transaction\TypeEndpoint instance
representing historic transactions.\GW2Treasures\GW2Api\V2\Endpoint\Commerce\Transaction\TypeEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
buys():Commerce\Transaction\ListEndpoint
Gets a new Commerce\Transaction\ListEndpoint instance
representing pending/completed buy transactions.sells():Commerce\Transaction\ListEndpoint
Gets a new Commerce\Transaction\ListEndpoint instance
representing pending/completed buy transactions.\GW2Treasures\GW2Api\V2\Endpoint\Commerce\Transaction\ListEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and 📄PaginatedEndpoint.
$api->commerce()->transactions('API_KEY')->current()->sells()->all();
// => [ { id: 1999, item_id: 19699, price: 1004, quantity: 20, created: "2014-12-15T14:43:36+00:00" }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Continent\ContinentEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
floors(int $continent_id):Continent\FloorEndpoint
Gets a new Continent\FloorEndpoint instance.$api->continents()->get(1);
// => { name: "Tyria", … }
\GW2Treasures\GW2Api\V2\Endpoint\Currency\CurrencyEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->currencies()->get(1);
// => { id: 1, name: "Coin", … }
\GW2Treasures\GW2Api\V2\Endpoint\Continent\FloorEndpoint
(source)
Implements 📦BulkEndpoint.
$api->continents()->floorsOf(1)->get(0);
// => { texture_dims: [ 32768, 32768 ], … }
\GW2Treasures\GW2Api\V2\Endpoint\Emblem\EmblemEndpoint
(source)
backgrounds():Emblem\LayerEndpoint
Gets a new Emblem\LayerEndpoint instance of all background layers.foregrounds():Emblem\LayerEndpoint
Gets a new Emblem\LayerEndpoint instance of all foreground layers.\GW2Treasures\GW2Api\V2\Endpoint\Emblem\LayerEndpoint
(source)
Implements 📦BulkEndpoint.
$api->emblem()->foregrounds()->get(1);
// => { id: 1, layers: [ "59641.png", "59643.png", "59645.png" ] }
\GW2Treasures\GW2Api\V2\Endpoint\File\FileEndpoint
(source)
Implements 📦BulkEndpoint.
$api->files()->ids();
// => [ "map_complete", "map_dungeon", … ]
\GW2Treasures\GW2Api\V2\Endpoint\Finisher\FinisherEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->finishers()->get();
// => { id:1, name: "Rabbit Rank Finisher", … }
\GW2Treasures\GW2Api\V2\Endpoint\Guild\DetailsEndpoint
(source)
Implements 🔒AuthenticatedEndpoint. The API key is optional.
get():array
Get the guild details of a guild.$api->guild()->detailsOf('GUILD_ID');
// => { id: "GUILD_ID", name: "Test Guild", tag: "API", … }
$api->guild()->detailsOf('GUILD_ID', 'API_KEY');
// => { level: 42, motd: "gw2treasures.com\n", id: "GUILD_ID", name: "Test Guild", tag: "API", … }
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\LogEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->logOf('API_KEY', 'GUILD_ID');
// => [ { id: 1190, time: "…", type: "treasury", user: "Lawton Campbell.9413", … }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\MemberEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->membersOf('API_KEY', 'GUILD_ID');
// => [ { name: "darthmaim.6017", rank: "Leader", joined: "2015-12-16T02:50:26.000Z" } ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\RankEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->ranksOf('API_KEY', 'GUILD_ID');
// => [ { id: "Leader", order: 1, permissions: [ "Admin", … ], icon: "…" }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\StashEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->stashOf('API_KEY', 'GUILD_ID')->get();
// => [ { upgrade_id: 1, size: 100, coins: 1002, note: "stash test", inventory: [] } ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\TeamEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->teamsOf('API_KEY', 'GUILD_ID')->get();
// => [ { id: 1, members: [], name: "ez game" } ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\TreasuryEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->treasuryOf('API_KEY', 'GUILD_ID')->get();
// => [ { id: 123, count: 100, needed_by: [] } ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\Authenticated\UpgradeEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and RestrictedGuildEndpoint.
$api->guild()->upgradesOf('API_KEY', 'GUILD_ID')->get();
// => [ 38, 43, 44, 51, 55, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\PermissionEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->guild()->permissions()->ids();
// => [ "ClaimableEditOptions", "EditBGM", "ActivatePlaceables", … ]
\GW2Treasures\GW2Api\V2\Endpoint\Guild\UpgradeEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->guild()->upgrades()->get(38);
// => { id: 38, name: "Guild Armorer 1", … }
\GW2Treasures\GW2Api\V2\Endpoint\Home\CatEndpoint
(source)
Implements 📦BulkEndpoint.
$api->home()->cats()->get('1');
// => { id: 1, hint: "chicken", … }
\GW2Treasures\GW2Api\V2\Endpoint\Home\NodeEndpoint
(source)
Implements 📦BulkEndpoint.
$api->mounts()->skins()->ids();
// => [ "advanced_cloth_rack", "advanced_leather_rack", … ]
\GW2Treasures\GW2Api\V2\Endpoint\Item\ItemEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->items()->ids();
// => [ 1, 2, 6, 11, 24, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Itemstat\ItemstatEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->itemstats()->get(137);
// => { id: 137, name: "Mighty", attributes: { Power: 0.35 } }
\GW2Treasures\GW2Api\V2\Endpoint\Legend\LegendEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->legends()->get('Legend1');
// => { id: "Legend1", swap: 28229, heal: 27220, … }
\GW2Treasures\GW2Api\V2\Endpoint\Map\MapEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->maps()->get(15);
// => { id: 15, name: "Queensdale", … }
\GW2Treasures\GW2Api\V2\Endpoint\Mastery\MasteryEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->masteries()->get(15);
// => { id: 1, name: "Exalted Lore", … }
\GW2Treasures\GW2Api\V2\Endpoint\Material\MaterialEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->materials()->lang('es')->all();
// => [ { id:5, name: "Materiales de cocina", items: [ 12134, … ] }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Mini\MiniEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->minis()->get(1);
// => { id: 1, name: "Miniature Rytlock", … }
\GW2Treasures\GW2Api\V2\Endpoint\Mount\TypeEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->mounts()->types()->get('raptor');
// => { id: "raptor", name: "Raptor", … }
\GW2Treasures\GW2Api\V2\Endpoint\Mount\SkinEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->mounts()->skins()->get(1);
// => { id: 1, mount: "raptor", … }
\GW2Treasures\GW2Api\V2\Endpoint\Novelty\NoveltyEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->novelties()->get(1);
// => { id: 1, name: "Embellished Kite", … }
\GW2Treasures\GW2Api\V2\Endpoint\Outfit\OutfitEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->outfits()->get(1);
// => { id: 1, name: "Cook's Outfit", … }
\GW2Treasures\GW2Api\V2\Endpoint\Pet\PetEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->pets()->get(1);
// => { id: 1, name: "Juvenile Jungle Stalker", … }
\GW2Treasures\GW2Api\V2\Endpoint\Profession\ProfessionEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->professions()->get('Warrior');
// => { id: "Warrior", name: "Warrior", … }
\GW2Treasures\GW2Api\V2\Endpoint\Pvp\AmuletEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->pvp()->amulets()->get(4);
// => { id: 4, name: "Assassin Amulet", … }
\GW2Treasures\GW2Api\V2\Endpoint\Pvp\GameEndpoint
(source)
Implements 🔒AuthenticatedEndpoint and 📦BulkEndpoint.
$api->pvp('API_KEY')->games()->get('A9F9FD97-F114-4F97-B2CA-5E814DF0340E');
// => { id: "A9F9FD97-F114-4F97-B2CA-5E814DF0340E", map_id: 795, … }
\GW2Treasures\GW2Api\V2\Endpoint\Pvp\SeasonEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->pvp()->seasons()->get('44B85826-B5ED-4890-8C77-82DDF9F2CF2B');
// => { id: "44B85826-B5ED-4890-8C77-82DDF9F2CF2B", name: "PvP League Season One", … }
\GW2Treasures\GW2Api\V2\Endpoint\Pvp\StandingEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():mixed
Get pvp standings.$api->pvp()->standings('API-KEY')->get();
// => [{ current: { total_points: 101, … }, best: { total_points: 200, … }, … }]
\GW2Treasures\GW2Api\V2\Endpoint\Pvp\StatsEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():mixed
Get pvp stats.$api->pvp('API_KEY')->stats()->get();
// => { pvp_rank: 57, aggregate: { wins: 343, … }, … }
\GW2Treasures\GW2Api\V2\Endpoint\Quaggan\QuagganEndpoint
(source)
Implements 📦BulkEndpoint.
$api->quaggans()->many(['cheer', 'party']);
// => [ { id: "cheer", url: "cheer.jpg" }, { id: "party", url: "party.jpg" } ]
\GW2Treasures\GW2Api\V2\Endpoint\Recipe\RecipeEndpoint
(source)
Implements 📦BulkEndpoint.
search():Recipe\SearchEndpoint
Gets a new Recipe\SearchEndpoint instance.$api->recipes()->ids();
// => [ 1, 2, 3, 4, 5, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Recipe\SearchEndpoint
(source)
input(int $id):mixed
Searches for recipes with $id
as ingredient.output(int $id):mixed
Searches for recipes with $id
as output.$api->recipes()->search()->input(43775);
// => [ 7259, 7260, 7261, 7262, … ]
\GW2Treasures\GW2Api\V2\Endpoint\Skill\SkillEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->skills()->get(1);
// => { name: "Bandage", facts: [ { text: "Recharge", type: "Recharge", icon: "…", value: 5 } ], … }
\GW2Treasures\GW2Api\V2\Endpoint\Skin\SkinEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->skins()->get(1);
// => { name: "Chainmail Leggings", type: "Armor", … }
\GW2Treasures\GW2Api\V2\Endpoint\Specialization\SpecializationEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->specializations()->get(1);
// => { id: 1, name: "Dueling", profession: "Mesmer", … }
\GW2Treasures\GW2Api\V2\Endpoint\Title\TitleEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->titles()->get(1);
// => { id: 1, name: "Traveler", achievement: 111 }
\GW2Treasures\GW2Api\V2\Endpoint\Story\StoryEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
seasons():Story\SeasonEndpoint
Gets a new Story\SeasonEndpoint instance.$api->stories()->get(1);
// => { id: 1, season: "215AAA0F-CDAC-4F93-86DA-C155A99B5784", name: "My Story", … }
\GW2Treasures\GW2Api\V2\Endpoint\Story\SeasonEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->stories()->seasons()->get('215AAA0F-CDAC-4F93-86DA-C155A99B5784');
// => { id: "215AAA0F-CDAC-4F93-86DA-C155A99B5784", name: "My Story", … }
\GW2Treasures\GW2Api\V2\Endpoint\Title\TitleEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->titles()->get(1);
// => { id: 1, name: "Traveler", achievement: 111 }
\GW2Treasures\GW2Api\V2\Endpoint\Tokeninfo\TokeninfoEndpoint
(source)
Implements 🔒AuthenticatedEndpoint.
get():mixed
Get info about the used api key.$api->tokeninfo('API_KEY')->get();
// => { id: "API_KEY", name: "key name", permissions: [ "account", … ] }
\GW2Treasures\GW2Api\V2\Endpoint\Traits\TraitEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->traits()->get(214);
// => { id: 214, tier:2, name: "Aeromancer's Training", … }
\GW2Treasures\GW2Api\V2\Endpoint\World\WorldEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->worlds()->all();
// => [ { id: 1001, name: "Anvil Rock" }, … ]
\GW2Treasures\GW2Api\V2\Endpoint\WvW\AbilityEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->wvw()->abilities()->get(2);
// => { id: 2, name: "Guard Killer", … }
\GW2Treasures\GW2Api\V2\Endpoint\WvW\MatchEndpoint
(source)
Implements 📦BulkEndpoint.
world(int $id):mixed
Get the current match of a world.$api->wvw()->matches()->get('2-6');
// => { id: "2-6", "scores": { red: 169331, blue: 246780, green: 216241 }, … }
\GW2Treasures\GW2Api\V2\Endpoint\WvW\ObjectiveEndpoint
(source)
Implements 📦BulkEndpoint and 🌏LocalizedEndpoint.
$api->wvw()->objectives()->get('968-98');
// => { id: "968-98", name: "Wurm Tunnel", … }
MIT © 2015 gw2treasures.com