WebAPI/GetPlayerItems

From Team Fortress Wiki
Jump to: navigation, search

URL

http://api.steampowered.com/IEconItems_<ID>/GetPlayerItems/v0001/

See the ID list for a valid ID.

Method-specific parameters

SteamID
The 64-bit ID of the user the backpack will be retrieved for.

Result data

result
status
The status of the request.
1
Success
8
The steamid parameter was invalid or missing.
15
Backpack is private.
18
The Steam ID given does not exist.
num_backpack_slots
The number of backpack slots this user has.
items
A list of item objects.
id
The unique ID of the specific item.
original_id
The ID of the item before it was customized, traded, or otherwise changed.
defindex
The defindex of the item, as found in the item array returned from GetSchema.
level
The arbitrary "level" value of the item as displayed in the inventory.
quantity
The number of "uses" an item has, generally only has a value in excess of '1' on "usable items", such as the Dueling Mini-Game.
origin[1] (Optional)
An integer used to lookup an origin name via GetSchema.
flag_cannot_trade (Optional)
A boolean value that is true if the item cannot be traded. Assume false if not present.
flag_cannot_craft (Optional)
A boolean value that is true if the item cannot be used in crafting. Assume false if not present.
inventory (Partially deprecated[2])
An inventory token as described here, or '0' if the item has been awarded and not yet found (placed in the backpack).
quality
The quality of the item (see definition in GetSchema).
custom_name (Optional)
The item's custom name if it has one.
custom_desc (Optional)
The item's custom description if it has one.
contained_item (Optional)
All the information for the item that this item contains for gift-wrapped items.
style (Optional)
An integer that can be used as an index to the item's style list.
attributes (Optional)
If the item has additional effects to the ones normally associated with it as described in GetSchema, contains a list of objects.
defindex
The index to the attributes definition in the schema, e.g. 133 for the medal number attribute for the Gentle Manne's Service Medal.
value
The value for this attribute for this item, e.g. the medal number for the Gentle Manne's Service Medal.
float_value (Optional)
The floating point value for this attribute if it has one.
account_info (Optional)
Set on attributes with a Steam ID as the value.
steamid
The specified user's unique 64-bit Steam ID.
personaname
The specified user's current name on Steam.
equipped[1] (Optional)
If the item is equipped, contains an array of equip information
class
The class the weapon is equipped to (numeric index).
0
Scout
1
Scout [3]
2
Sniper
3
Soldier
4
Demoman
5
Medic
6
Heavy
7
Pyro
8
Spy
9
Engineer
slot
The slot the weapon is equipped in (numeric index).
0
Primary
1
Secondary
2
Melee
4
Building
6
PDA2
7
Head
8
Misc 1
9
Action
10
Misc 2
65535
Set when the class had the item equipped previously.

Inventory token

The inventory token is a combination of class loadout flags and position in the player's backpack. This unsigned 32-bit integer is split into two two-byte words. The high word contains flags for each class. 1-bit in a class's slot indicates that the item is equipped in the appropriate loadout slot for that class. The low word contains the backpack position with '0' if the item has been awarded, but not yet found (placed in the backpack), '1' being the upper left slot, '2' the second slot from the left on the top row, etc. Here it is visually:


  ┌─────────────────────────────────────────────────────────────── Always '1'
  │ ┌─┬─┬─┬─┬─┬─────────────────────────────────────────────────── Placed in Backpack[4]
  │ │ │ │ │ │ │ ┌───────────────────────────────────────────────── Engineer 
  │ │ │ │ │ │ │ │ ┌─────────────────────────────────────────────── Spy 
  │ │ │ │ │ │ │ │ │ ┌───────────────────────────────────────────── Pyro 
  │ │ │ │ │ │ │ │ │ │ ┌─────────────────────────────────────────── Heavy 
  │ │ │ │ │ │ │ │ │ │ │ ┌───────────────────────────────────────── Medic 
  │ │ │ │ │ │ │ │ │ │ │ │ ┌─────────────────────────────────────── Demoman 
  │ │ │ │ │ │ │ │ │ │ │ │ │ ┌───────────────────────────────────── Soldier 
  │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┌─────────────────────────────────── Sniper (or Atlas)
  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┌───────────────────────────────── Scout (or P-Body)
  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─ Backpack position 
  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Examples:

  1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1  Equipped Pyro item 
                                                                   in backpack slot 9
  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1  Unequipped item 
                                                                   in backpack slot 41
  1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0  Equipped by Pyro and Engineer
                                                                   in backpack slot 42

Notes

  1. 1.0 1.1 Specific to the TF2 interface.
  2. Assume fields for equipped classes to be incorrect, favor equipped
  3. This is probably the correct mapping for the scout and all equipped fields with 0 in it will probably have this as well. I'm guessing this is either an off-by-one bug or a workaround of it
  4. This bit is 0 when the item has been placed in the backpack and has its own slot. It is 1 if it has been recently dropped/traded for and it hasn't been allocated a backpack space.