API:2/characters/:id/inventory

From Guild Wars 2 Wiki
Jump to: navigation, search

/v2/characters/:id/inventory

HTTP method
GET
Format
json
API version
version 2
Release date
2015-05-22
Scope
account
characters
Optional
none

This resource returns information about the inventory of a character attached to a specific account.

Parameters

  • access_token - (optional) If the API key is not specified in the request header, it can be specified here.

Response

  • bags (array) - Contains one object structure per bag in the character's inventory
    • id (integer) - The bag's item id which can be resolved against /v2/items
    • size (integer) - The amount of slots available with this bag.
    • inventory (array) - Contains one object structure per item, object is null if no item is in the given bag slot.
      • id (integer) - The item id which can be resolved against /v2/items
      • count (integer) - Amount of item in the stack. Minium of 1, maximum of 250.
      • infusions (array) (optional) - returns an array of infusion item ids which can be resolved against /v2/items
      • upgrades (array) (optional) - returns an array of upgrade component item ids which can be resolved against /v2/items
      • skin (integer) (optional) - Skin id for the given equipment piece. Can be resolved against /v2/skins
      • stats (object) (optional) - Contains information on the stats chosen if the item offers an option for stats/prefix.
        • id (integer) - The itemstat id, can be resolved against /v2/itemstats.
        • attributes (object) - Contains a summary of the stats on the item.
          • Power (integer) (optional) - Shows the amount of power given
          • Precision (integer) (optional) - Shows the amount of Precision given
          • Toughness (integer) (optional) - Shows the amount of Toughness given
          • Vitality (integer) (optional) - Shows the amount of Vitality given
          • Condition Damage (integer) (optional) - Shows the amount of Condition Damage given
          • Condition Duration (integer) (optional) - Shows the amount of Condition Duration given
          • Healing (integer) (optional) - Shows the amount of Healing Power given
          • BoonDuration (integer) (optional) - Shows the amount of Boon Duration given
      • binding (string) (optional) - describes which kind of binding the item has. Possible values:
        • Character
        • Account
      • bound_to (string) (optional, only if character bound) - Name of the character the item is bound to.

Example

Request

  https://api.guildwars2.com/v2/characters/<character name>/inventory
  Authorization: Bearer <API key>

  https://api.guildwars2.com/v2/characters/<character name>/inventory?access_token=<API key>

Response

{
  "bags": [
    {
      "id": 87225,
      "size": 32,
      "inventory": [
        {
          "id": 42877,
          "count": 4,
          "binding": "Account"
        },
        {
          "id": 8469,
          "count": 1,
          "binding": "Account"
        },
        {
          "id": 71836,
          "count": 1,
          "skin": 746,
          "upgrades": [
            71425
          ],
          "dyes": [
            6,
            315,
            453,
            1
          ],
          "binding": "Character",
          "bound_to": "Chieftain Alex"
        },
        ...
        {
          "id": 46735,
          "count": 250,
          "binding": "Account"
        }
      ]
    },
    {
      "id": 8932,
      "size": 20,
      "inventory": [
        {
          "id": 46735,
          "count": 250,
          "binding": "Account"
        },
        {
          "id": 46735,
          "count": 180,
          "binding": "Account"
        },
        {
          "id": 77656,
          "count": 1,
          "binding": "Account"
        },
        null,
        null,
        ...
        null,
        null
      ]
    }
  ]
}