API:2
Version 2 of the Guild Wars 2 API was first mentioned on July 16th 2014, when the root and quaggans endpoint was made available. On September 8th 2014, the commerce endpoints were enabled, and on February 24th, 2015 the account endpoints were enabled.
This version is primarily an interface change, introducing a resourceful structure to access elements and the ability to query multiple resources at once. Version 2 is publicly available over HTTPS, though several endpoints that access account information require authentication via an API key.
Active endpoints
The base URL for all endpoints is https://api.guildwars2.com
.
- /v2/account
- /v2/account/achievements
- /v2/account/bank
- /v2/account/buildstorage
- /v2/account/dailycrafting
- /v2/account/dungeons
- /v2/account/dyes
- /v2/account/emotes
- /v2/account/finishers
- /v2/account/gliders
- /v2/account/home
- /v2/account/inventory
- /v2/account/legendaryarmory
- /v2/account/luck
- /v2/account/mailcarriers
- /v2/account/mapchests
- /v2/account/masteries
- /v2/account/mastery/points
- /v2/account/materials
- /v2/account/minis
- /v2/account/mounts
- /v2/account/novelties
- /v2/account/outfits
- /v2/account/pvp/heroes
- /v2/account/raids
- /v2/account/recipes
- /v2/account/skins
- /v2/account/titles
- /v2/account/wallet
- /v2/account/worldbosses
- /v2/achievements
- /v2/backstory
- /v2/build
- /v2/characters
- /v2/characters/:id/backstory
- /v2/characters/:id/buildtabs
- /v2/characters/:id/core
- /v2/characters/:id/crafting
- /v2/characters/:id/equipment
- /v2/characters/:id/equipmenttabs
- /v2/characters/:id/heropoints
- /v2/characters/:id/inventory
- /v2/characters/:id/quests
- /v2/characters/:id/recipes
- /v2/characters/:id/sab
- /v2/characters/:id/skills
- /v2/characters/:id/specializations
- /v2/characters/:id/training
- /v2/colors
- /v2/commerce (returns 404/503 errors if requested, directly request the sub-endpoints below)
- /v2/continents
- /v2/createsubtoken
- /v2/currencies
- /v2/dailycrafting
- /v2/dungeons
- /v2/emblem
- /v2/emotes
- /v2/files
- /v2/finishers
- /v2/gliders
- /v2/guild (returns 404/503 errors if requested, directly request the sub-endpoints below)
- /v2/home/cats
- /v2/home/nodes
- /v2/items
- /v2/itemstats
- /v2/legends
- /v2/mailcarriers
- /v2/mapchests
- /v2/maps
- /v2/masteries
- /v2/materials
- /v2/minis
- /v2/mounts
- /v2/novelties
- /v2/outfits
- /v2/pets
- /v2/professions
- /v2/pvp
- /v2/quaggans
- /v2/quests
- /v2/races
- /v2/raids
- /v2/recipes
- /v2/skills
- /v2/skins
- /v2/specializations
- /v2/stories
- /v2/titles
- /v2/tokeninfo
- /v2/traits
- /v2/worldbosses
- /v2/worlds
- /v2/wvw
Accessing resources
Each endpoint can be accessed directly to get a list of resources. Each resource can be accessed as a subpath of the endpoint. Alternatively, a single resource can also be accessed by specifying the id
query parameter at the base endpoint. Multiple resources can be specified by specifying the ids
query parameter instead. The latter expects a comma-separated list of identifiers and returns an array of objects instead.
For example, /v2/quaggans
returns a list of quaggan identifiers, e.g. "hat"
and "box"
.
- A single resource, e.g. the "hat" quaggan, can be accessed at
/v2/quaggans/hat
or/v2/quaggans?id=hat
. - Multiple resources, e.g. both the "hat" and "box" quaggans, can be accessed at
/v2/quaggans?ids=hat,box
.
Some resources accept ids=all
to expand all resources at once.
Paging
The endpoints support paging using the page
and page_size
query parameters. Specifying a page will automatically expand alls resources. The default page size is 50, the maximum size is currently 200.
When accessing a page, additional HTTP response headers may be available:
X-Page-Size
– The size of a page (like thepage_size
query parameter).X-Page-Total
– The total number of pages.X-Result-Count
– The number of resources on the current page (lower or equal to the page size).X-Result-Total
– The total number of resources.
Authentication
All of the endpoints which fetch account data require the use of an API key. There are currently two ways to provide an API key along with your request.
- Adding the
Authorization
HTTP header to your request with the valueBearer <API key>
. - Adding the parameter
?access_token=<API key>
to your request URL.
See API key for a list of the authenticated endpoints and their required permissions.
Localisation
All of the endpoints which are locale-aware accept a language parameter. There are currently two ways to provide this language parameter along with your request.
- Adding the
Accept-Language
HTTP header with the value of<language>
, which also gets set by the browser by default. - Adding the parameter
?lang=<language>
to your request URL.
Valid languages are en
, es
, de
, fr
and zh
. If no language parameter is set, the language defaults to en
.
Schemas
Selected endpoints support different Schema versions. There are currently two ways to specify a Schema version alongside a request.
- Adding the
X-Schema-Version
HTTP header to a request with an ISO-8601 datetime as value. - Adding the parameter
?v=<ISO-8601 datetime>
to a request URL.
Schema versions supported by an endpoint, where applicable, are indicated on a specific endpoints Page.
A list of schema versions can be found upon the V2 JSON endpoint.
Responses
API requests will return a JSON response body describing the requested content, or error message, if applicable. Additionally, the HTTP response code can be used to determine the state of the response body.
Success
- HTTP
200
will be returned if all of the requested data has been returned. - HTTP
206
will be returned when using theids
parameter if at least one, but not all of the provided IDs are valid.
Errors
- HTTP
403
will be returned if attempting to access an authenticated endpoint without a valid API key, or with a valid API key without the necessary permissions. - HTTP
404
will be returned if an endpoint does not exist, or all of the provided IDs are invalid. - HTTP
503
will be returned if an endpoint is disabled.