WoW API < GetItemCount

Returns count information for the item.

count = GetItemCount(itemID or "itemName" or "itemLink"[, includeBank][, includeCharges])

Arguments Edit

itemID / "itemName" / "itemLink" 
Number/String/String - Numeric ID of the item, name of the item, or itemLink of the item to query.
(itemId or "itemName" or "itemLink", includeBank, includeCharges)
Boolean - true: count includes bank items
Boolean - true: count is charges if any, otherwise number of items

Returns Edit

Number - The number of items in your possesion, or charges if includeCharges is true and the item has charges.

Example Edit

local count = GetItemCount(29434)
print("Badge of Justice:", count)
local count = GetItemCount(33312, nil, true) 
print("Mana Saphire Charges:", count)
local countBags = GetItemCount("Netherweave Cloth")
local countTotal = GetItemCount("Netherweave Cloth", true)
print("Netherweave Cloth:", countBags, "(bags)", (countTotal - countBags), "(bank)")

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.