User:Tekkub/API Sandbox

Return information about a specific item. itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(itemID or "itemString" or "itemName" or "itemLink")

Parameters
The string returned is also the name of a global string variable, i.e. for "INVTYPE_HEAD" there is a INVTYPE_HEAD variable containing a localized, displayable name of the location.

Example
local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = GetItemInfo(16846) ChatFrame1:AddMessage(sName..", "..iRarity..", "..sType..", "..iStackCount) -- prints: "Giantstalker's Helmet,4,Armor,1"

Details

 * This function will ONLY retrieve data that is in your local cache.
 * If you have never seen the item that belongs to the Item ID or Item Link it will return nil.
 * All string returns (itemName, itemType, itemSubType) are localized. Prior to 1.9, itemEquipLoc was localized also.

Common usage
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(link)