Maxx53 / SCMBot

Steam Community Market auto-buying bot
http://scmbot.com
GNU General Public License v2.0
238 stars 116 forks source link

How do you get the price of the items? #563

Open lpares12 opened 8 years ago

lpares12 commented 8 years ago

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 "grgListingInfo" 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 headerList = new ArrayList(); 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.

immorro commented 8 years ago

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

lpares12 commented 8 years ago

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 commented 8 years ago

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.

mtzi commented 8 years ago

@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.

immorro commented 8 years ago

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

Justmau5 commented 8 years ago

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

immorro commented 8 years ago

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

Justmau5 commented 8 years ago

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

immorro commented 8 years ago

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

lpares12 commented 8 years ago

@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?

Justmau5 commented 8 years ago

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

immorro commented 8 years ago

@Justmau5 одного

mtzi commented 8 years ago

@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

Dragonofhell commented 8 years ago

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

immorro commented 8 years ago

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