Search code examples
steamsteam-web-apisteamworks-api

Steam API for getting trade hold duration for an item (CS:GO)


I am making a website which shows items of a user's inventory. Using the steam inventory api https://steamcommunity.com/inventory/ I am able to get inventory and with https://steamcommunity.com/market/priceoverview/ I am able to get the market value of an item.

Both the above api's don't give any information regarding an item being on hold, I was just able to see tradable: false for items on hold.

Is there a way to get the trade hold duration of a particular item?


Solution

  • I think you are confusing two different terms here. Items are on trade hold when you don't have mobile confirmation enabled, in this case the items are not visible in inventories, if you can't see the item you can't see it's trade gold status either. What I think you are trying to ask is the more commonly used "trade lock" status of the item.

    I have made a site (whatstradelocked.com) after the 7 day trade lock was introduced and I am a developer of an extension (csgotrader.app) that also uses this information.

    If you use this endpoint: https://steamcommunity.com/profiles/${steamID}/inventory/json/730/2/?l=english to request inventories than you can find the cache_expiration property that hold the trade lock status of the item.

    You can see how I do it in my extension in this file on GitHub: https://github.com/gergelyszabo94/csgo-trader-extension/blob/bd2ec351d0caf0173eeb7a97d7a1f19dc0e36baa/extension/src/utils/getUserCSGOInventory.js