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.

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Ariel Weinberger
  • 2,195
  • 4
  • 23
  • 49
  • If there isn't an API, you should be able to scrape the HTML for the tag containing the price. Check this out http://stackoverflow.com/questions/23055673/get-the-price-of-an-item-on-steam-community-market-with-php-and-regex – TheBat Oct 02 '14 at 21:54

7 Answers7

48

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.

kiwixz
  • 1,380
  • 15
  • 23
  • 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): http://backpack.tf/api/market Their servers seem faster and more stable than Valve's. – rannmann May 28 '15 at 21:10
  • 7
    Also, Valve will temporary ban you (for a few minutes) if you ask excessively. – kiwixz May 29 '15 at 05:28
  • @rannman looks like the URL has changed. Here's the developer page, which includes links to the API docs for CSGO on backpack: https://csgo.backpack.tf/developer – MikeyE Aug 27 '19 at 02:11
  • what does the `volume` object mean? – Violet Aug 09 '21 at 07:36
  • 1
    @Violet I'm pretty sure this is the number of items sold in the last 24h – kiwixz Aug 09 '21 at 19:28
  • @kiwixz yup when using this, caching is absolutely essential – Xantium Dec 20 '21 at 10:27
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
Captnwalker1
  • 679
  • 7
  • 16
22

I indexed the available currencies steam uses for argument

&currency=3

as:

1 : $63.83

2 : £46.85

3 : 52,--€

4 : CHF 56.41

5 : 4721,76 pуб.

6 : 235,09zł

7 : R$ 340,80

8 : ¥ 6,627.08

9 : 534,70 kr

10 : Rp 898 383.24

11 : RM257.74

12 : P3,072.66

13 : S$84.47

14 : ฿1,921.93

15 : 1.474.136,93₫

16 : ₩ 69,717.79

17 : 468,47 TL

18 : 2 214,94₴

19 : Mex$ 1,557.75

20 : CDN$ 99.09

21 : A$ 100.40

22 : NZ$ 107.55

23 : ¥ 505.96

24 : ₹ 5,733.04

25 : CLP$ 55.695,47

26 : S/.283.03

27 : COL$ 271.637,06

28 : R 1 193.49

29 : HK$ 606.83

30 : NT$ 2,189.42

31 : 293.64 SR

32 : 287.51 AED

Python dictionary with currency abbreviations and their codes:

currencies = {
    "USD": 1,  # United States dollar
    "GBP": 2,  # British pound sterling
    "EUR": 3,  # The euro
    "CHF": 4,  # Swiss franc
    "RUB": 5,  # Russian ruble
    "PLN": 6,  # Polish złoty
    "BRL": 7,  # Brazilian real
    "JPY": 8,  # Japanese yen
    "SEK": 9,  # Swedish krona
    "IDR": 10,  # Indonesian rupiah
    "MYR": 11,  # Malaysian ringgit
    "BWP": 12,  # Botswana pula
    "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 dollar
    "AUD": 21,  # Australian dollar
    "NZD": 22,  # New Zealand dollar
    "CNY": 23,  # Chinese 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
}
shtosh
  • 95
  • 1
  • 6
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).

OrderFromChaos
  • 164
  • 2
  • 6
2

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.

Kristjan Kirpu
  • 674
  • 1
  • 7
  • 26
1

There is not such API for now. But this link may help you: Get the price of an item on Steam Community Market with PHP and Regex It's basically what you want with pure php DOM parsing instead of an API. The main drawback is that you may have to change your code if Steam update their html markup.

Community
  • 1
  • 1
ClemSndr
  • 295
  • 1
  • 5
0

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

VityaSchel
  • 579
  • 7
  • 18