SCMBot icon indicating copy to clipboard operation
SCMBot copied to clipboard

How do you get the price of the items?

Open lpares12 opened this issue 10 years ago • 15 comments

Hi Maxx53, I've been doing a similar bot in java, and I've encountered a problem when getting the listings. For example, when I go to: http://steamcommunity.com/market/listings/730/AK-47%20%7C%20Frontside%20Misty%20%28Field-Tested%29 I get the prices in $,€ and other currencies. I imagine you get the "g_rgListingInfo" and then you look for the cheapest price. The problem is that with google chrome, firefox,.. in this variable I get the currency always in € while in my bot I get it with mixed currencies. Did you find the same problem? How did you fix it? When requesting the webpage I send this headers: List<NameValuePair> headerList = new ArrayList<NameValuePair>(); headerList.add((NameValuePair) new BasicNameValuePair("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8")); headerList.add((NameValuePair) new BasicNameValuePair("Accept-Language", "en, es;q=0.8")); headerList.add((NameValuePair) new BasicNameValuePair("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36")); headerList.add((NameValuePair) new BasicNameValuePair("Cookie", client.getCookiesMarket())); headerList.add((NameValuePair) new BasicNameValuePair("Referer", "http://steamcommunity.com/market/")); headerList.add((NameValuePair) new BasicNameValuePair("Upgrade-Insecure-Requests", "1"));

The cookies I send are: sessionid steamcountry steamlogin webtradelegibility timezoneoffset

Any ideas? Sorry I bother you, but your project was the more similiar to mine that I could find in the internet! Thanks again.

lpares12 avatar Dec 06 '15 15:12 lpares12

easy http://steamcommunity.com/market/listings/730/AK-47%20%7C%20Redline%20%28Field-Tested%29/render/?query=&start=0&count=10&country=UA&language=english&currency=1

immorro avatar Dec 06 '15 19:12 immorro

You saved my life dude hahaha, I was scrapping the webpage. I suppose: AK-47%20%7c%20Redline%20%28Field-Tested%29 is the hash-name, right?

lpares12 avatar Dec 06 '15 22:12 lpares12

By the way, is there any limit of queries per minute? Like in: http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=M4A1-S%20%7C%20Hyper%20Beast%20%28Field-Tested%29 you can only do 20 queries per minute, and if you do more they ban your IP from steam api.

lpares12 avatar Dec 06 '15 23:12 lpares12

@lluk12 its not per minute, its in a longer run, i believe in close to 10.000 requests for 8-12 hours i seem to avoid getting IP banned when sending 1 req per 5sec (12 per min) (720 per hour) You will notice if u have it working, the faster u send req's the faster u get banned.

mtzi avatar Dec 07 '15 12:12 mtzi

idk about priceoverview, but have some stat for listings query untitled 1 green-success red-429 at night(+2 cet) errors~5% day~11% this is for 10sec timer

immorro avatar Dec 07 '15 16:12 immorro

@immorro а что по точности скана? Цены актуальны?

Justmau5 avatar Dec 07 '15 16:12 Justmau5

@Justmau5 конечно, я же получаю листинги, цены на них не меняются

immorro avatar Dec 07 '15 16:12 immorro

На счет лимита запросов, я уже давно об этом думал, значит кто то уже посчитал?

Justmau5 avatar Dec 07 '15 16:12 Justmau5

@Justmau5 ну выше парень писал про 10к реквестов. Я тестил для таймера в 8-9-10 секунд на много итераций - бан так ниразу и не получил...хз правда, как он с интервалом в 5сек запросы шлет - у меня очень много 429 возвращается

immorro avatar Dec 07 '15 17:12 immorro

@mtzi so the best way of getting the prices would be to put all the items in a db and then to have an script in the background to update an item price every 5 seconds, right?

lpares12 avatar Dec 07 '15 17:12 lpares12

@immorro ты листинг одного предмета сканил или скольких?

Justmau5 avatar Dec 07 '15 17:12 Justmau5

@Justmau5 одного

immorro avatar Dec 07 '15 17:12 immorro

@lluk12 sounds about right, however im not sure how the steam servers handle those requests sent by you, as one or as multiples, so if what you do is update all 5 at the same time, it might counts as 5 requests and not 1, not into programming, so im not sure how u can fix that

mtzi avatar Dec 07 '15 17:12 mtzi

@immorro есть скайп\вк ? пытать не буду . есть мыслишка одна

Dragonofhell avatar Dec 14 '15 05:12 Dragonofhell

@Dragonofhell сейчас категорически нет времени реализовывать все "мыслишки", но написать можешь...мб позже время появится. /immorro

immorro avatar Dec 15 '15 01:12 immorro