I can see how many gems an item in my inventory converts to when I turn it into gems. But is there any way to know how many gems I would get for an item I do not own?
A simple search in google would direct you to the "Gems by Game" section of the Steam Trading Card Wiki.
You can both find the value of the cards theirselves and the craftable items (Emoticons, Backgrounds). Additionally the needed amount of gems to craft a booster pack is also displayed.
Keep in mind, that the entries in the wikis aren't displayed dynamically, means that some values might be not up to date. Furthermore I assume that there are many games missing, but the list is very long though.
Very interesting is following, what I copied & pasted from the source above:
n = # cards in set,
c = value of single card,
g = value of emoticon/background, and
b = gems to craft booster, any one of the four can be calculated if any two other values are known. This doesn't hold true for every game, but is accurate for the vast majority:
n = 6000/b
n = 2g/c
c = bg/3000
c = 2g/n
g = 3000c/b
g = n * c/2
b = 6000/n
b = g/3000c
Here's a bookmarklet that you can run on the Community Market page for an item to get its gem value:
When you're on the Community Market page for an item, paste this into the URL bar (you might have to retype the
As noted by Wok, you can get the number of gems an item is worth by passing the appropriate
item_type to this endpoint:
which in this example corresponds to my favorite profile background from the game Antichamber and returns this response:
But as noted by Wok and an answer to a similar question,
item_type isn't exactly predictable and depends on the game and the relative amounts of item types that they have.
How does the Steam inventory webpage figure out what
It's pretty gross.
When you load your inventory, the webpage makes a few requests (one for each context in that inventory) to get a list of inventory items. These JSON responses contain the
item_type for each item, but in the worst format possible.
Each inventory object in the
descriptions array of the JSON response contains an
owner_actions array, where each object has a
link and a
item_type is stored in that link.
Sticking to the Antichamber profile background example, here's the link with its
GetGooValue() doesn't actually exist.
In case you didn't see it, the third argument to this nonexistent function provides
appid and the fourth argument provides
What about items not in your inventory?
The previous web requests depend on a user's inventory, which isn't helpful if you want to find the gem value of some arbitrary item.
However, Community Market pages have a global variable called
g_rgAssets. Here's a truncated sample for our example:
So there's a sole child called the inventory ID, which itself has a sole child corresponding to the context ID. That in turn has a sole child called something (I don't know what it corresponds to), and inside of that is the same
owner_actions we saw earlier (among other things).
From there it's pretty easy to find that link, parse out the
item_type, and make the web request to find the gem value of that item.
Something to watch out for: you can't just select the link of the first object in
- There can be more than one action in there, such as the "View badge progress" action for trading cards.
- The "Turn into Gems..." action doesn't show up on items that don't have gem values.
The bookmarklet above has some rudimentary handling for these cases.
- Find the
appIDof the game, e.g.
- Check the gem amount corresponding to a normal card (
- Check the gem amount corresponding to a foil card (
- Check the gem amount corresponding to an emoticon (
- Check the gem amount corresponding to a profile background (
item_type numbering can differ from one game to another:
- the index of the first card is always 2,
- the index of the first emoticon can change depending on the number of cards,
- the index of the first profile background can change depending on the number of cards, the number of emoticons, and the existence of gaps in the numbering for unknown reasons.
So, adjust accordingly and check the other values if you have any doubt.