Steam Market API?
Asked Answered
D

6

29

I know that there's a Steam API allowing me to use data from Steam Community.
My question is, does anyone know if there's a Steam Market API?
For example, I want to get the current price of an item in the Steam Market.

I've googled and haven't found anything yet.
I'd be glad to have your help.

Devest answered 2/10, 2014 at 21:49 Comment(1)
If there isn't an API, you should be able to scrape the HTML for the tag containing the price. Check this out #23056173Minimum
S
49

I could not find any documentation, but I use:

http://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=StatTrak%E2%84%A2 M4A1-S | Hyper Beast (Minimal Wear)

to return a JSON. At time of writing, it returns:

{"success":true,"lowest_price":"261,35€ ","volume":"11","median_price":"269,52€ "}

You can change the currency. 1 is USD, 3 is euro but there are probably others.

Scallop answered 22/5, 2015 at 10:25 Comment(7)
This is the best solution I'm aware of if you want just one item. If you want an entire game though, backpack.tf provides their own API that updates (at least hourly if not more often): backpack.tf/api/market Their servers seem faster and more stable than Valve's.Terry
Also, Valve will temporary ban you (for a few minutes) if you ask excessively.Scallop
@rannman looks like the URL has changed. Here's the developer page, which includes links to the API docs for CSGO on backpack: csgo.backpack.tf/developerNuncle
what does the volume object mean?Amuck
@Violet I'm pretty sure this is the number of items sold in the last 24hScallop
@Scallop yup when using this, caching is absolutely essentialMoskowitz
Why do I sometimes get a response like {"success": true, "volume": 29, "median_price": "$3.45"} and I get no lowest_price?Marcel
E
23

A better search api that can give you all the results for a game, example using pubg which only has 272 items, if your game has more try changing the count parameter at the end

https://steamcommunity.com/market/search/render/?search_descriptions=0&sort_column=default&sort_dir=desc&appid=578080&norender=1&count=500
Eccrinology answered 25/5, 2018 at 19:40 Comment(2)
Even if count >100; it still only shows 100 results. I solved that by multiple requests utilizing the start parameter.Phosphaturia
Use sort_column=name as well. I think its random if you use defaultMedullary
P
22

Using the currency parameter you can change which local currency steam returns.

&currency=1 # USD
&currency=2 # GBP
&currency=3 # EUR
&currency=4 # CHF
...

Here are the current integer values for the currency parameter (according to https://partner.steamgames.com/doc/store/pricing/currencies).

1 - USD / United States Dollar

2 - GBP / United Kingdom Pound

3 - EUR / European Union Euro

4 - CHF / Swiss Francs

5 - RUB / Russian Rouble

6 - PLN / Polish Złoty

7 - BRL / Brazilian Reals

8 - JPY / Japanese Yen

9 - NOK / Norwegian Krone

10 - IDR / Indonesian Rupiah

11 - MYR / Malaysian Ringgit

12 - PHP / Philippine Peso

13 - SGD / Singapore Dollar

14 - THB / Thai Baht

15 - VND / Vietnamese Dong

16 - KRW / South Korean Won

17 - TRY / Turkish Lira

18 - UAH / Ukrainian Hryvnia

19 - MXN / Mexican Peso

20 - CAD / Canadian Dollars

21 - AUD / Australian Dollars

22 - NZD / New Zealand Dollar

23 - CNY / Chinese Renminbi (yuan)

24 - INR / Indian Rupee

25 - CLP / Chilean Peso

26 - PEN / Peruvian Sol

27 - COP / Colombian Peso

28 - ZAR / South African Rand

29 - HKD / Hong Kong Dollar

30 - TWD / New Taiwan Dollar

31 - SAR / Saudi Riyal

32 - AED / United Arab Emirates Dirham

33 (Discontinued) - SEK / Swedish Krona

34 - ARS / Argentine Peso

35 - ILS / Israeli New Shekel

36 (Discontinued) - BYN / Belarusian Ruble

37 - KZT / Kazakhstani Tenge

38 - KWD / Kuwaiti Dinar

39 - QAR / Qatari Riyal

40 - CRC / Costa Rican Colón

41 - UYU / Uruguayan Peso

42 (Discontinued) - BGN / Bulgarian Lev

43 (Discontinued) - HRK / Croatian Kuna

44 (Discontinued) - CZK / Czech Koruna

45 (Discontinued) - DKK / Danish Krone

46 (Discontinued) - HUF / Hungarian Forint

47 (Discontinued) - RON / Romanian Leu

Here's the Python dictionary that would represent the same thing (with discontinued values omitted).

{
    "USD": 1, # United States Dollar
    "GBP": 2, # United Kingdom Pound
    "EUR": 3, # European Union Euro
    "CHF": 4, # Swiss Francs
    "RUB": 5, # Russian Rouble
    "PLN": 6, # Polish Złoty
    "BRL": 7, # Brazilian Reals
    "JPY": 8, # Japanese Yen
    "NOK": 9, # Norwegian Krone
    "IDR": 10, # Indonesian Rupiah
    "MYR": 11, # Malaysian Ringgit
    "PHP": 12, # Philippine Peso
    "SGD": 13, # Singapore Dollar
    "THB": 14, # Thai Baht
    "VND": 15, # Vietnamese Dong
    "KRW": 16, # South Korean Won
    "TRY": 17, # Turkish Lira
    "UAH": 18, # Ukrainian Hryvnia
    "MXN": 19, # Mexican Peso
    "CAD": 20, # Canadian Dollars
    "AUD": 21, # Australian Dollars
    "NZD": 22, # New Zealand Dollar
    "CNY": 23, # Chinese Renminbi (yuan)
    "INR": 24, # Indian Rupee
    "CLP": 25, # Chilean Peso
    "PEN": 26, # Peruvian Sol
    "COP": 27, # Colombian Peso
    "ZAR": 28, # South African Rand
    "HKD": 29, # Hong Kong Dollar
    "TWD": 30, # New Taiwan Dollar
    "SAR": 31, # Saudi Riyal
    "AED": 32, # United Arab Emirates Dirham
    "ARS": 34, # Argentine Peso
    "ILS": 35, # Israeli New Shekel
    "KZT": 37, # Kazakhstani Tenge
    "KWD": 38, # Kuwaiti Dinar
    "QAR": 39, # Qatari Riyal
    "CRC": 40, # Costa Rican Colón
    "UYU": 41 # Uruguayan Peso
}
Planksheer answered 10/1, 2021 at 13:15 Comment(1)
You can use 34 for Argentinian pesos, not sure why 33 isn't being used though.Zeph
A
16

To add to what the other people have said, the temporary ban on the JSON site happens if you try and request 20 items within a minute's time from the server. If you're creating a script to request those links, add a three second delay between each script. Also, the ban only lasts for the remaining server-side minute (which may not be 60 seconds).

Antler answered 4/12, 2016 at 9:1 Comment(1)
This doesn't answer the question.Haplite
T
1

You can use SteamApis.com to acquire Steam market prices and item information. The data is returned in JSON. The service is not free but also not that expensive.

The documentation is available to view here. It has detailed information on what endpoints are available and what data is returned.

Therefrom answered 10/3, 2017 at 17:34 Comment(0)
C
1

Script-scraper which maps search results from https://steamcommunity.com/market/search?q= to array of objects

Array.from(document.querySelectorAll('a.market_listing_row_link')).map(item => {
  const itemInfo = item.children[0]
  return {
    isStatTrek: itemInfo.getAttribute('data-hash-name').startsWith('StatTrak™'),
    condition: itemInfo.getAttribute('data-hash-name').match(/.*\((.*)\)/)[1],
    priceUSD: Number(itemInfo.querySelector('.normal_price[data-price]').getAttribute('data-price')/100)
  }
})

can be used with iframe and "weapon | skin name (condition)" search template

Cherie answered 6/1, 2022 at 13:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.