L
L
LemanRass092017-01-04 15:10:55
PHP
LemanRass09, 2017-01-04 15:10:55

How to get a list of things in the inventory in steam?

Hello.
How can I get users' inventories on steam with minimal restrictions on the number of requests?
I just made a link through the standard:

http://steamcommunity.com/profiles/*profileid*/inventory/json/730/2

using php-curl and recursive javascript function with ajax request to php handler. But making only a few requests even with a 3 sec pause between requests, I still manage to get an error 429 which means that I made too many requests and I get banned for a long time. Apparently this restriction is imposed by the Steam administration and it is useless to fight it.
That's why I decided to ask if there are workarounds? How else can I get a user's inventory in steam? Because if there is no adequate solution, I'm already going to order 11 virtual hostings with php processors that will take only 1 inventory each and return to the same javascript as the ajax callback parameter of the done function.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PerfectoWeb, 2017-01-06
@LemanRass09

1) Write a parser file that will request inventory every minute or 2-3 and save it on your server (via crontab)
2) Take the data from the one saved on your server
3) After each trade in which the bot gives away items, clear them also in local JSON. To not wait a minute for an update.
4) Also write to JSON (local) new items whose trades are successfully completed. That is, at the moment the bot accepts any items.
New products that appeared on the bot not through the site, of course, will appear on the bot in a minute (or 2-3, how many set on crontab), but this is not so critical.
Всегда, когда используете частые запросы на чужие сервисы (даже Yandex, Google Maps), всегда желательно кешировать у себя данные и обновлять их по мере необходимости. В таком раскладе, ваш сайт сможет функционировать даже тогда, когда сторонний сервис недоступен.
PS: 11 серверов для 11 ботов, это самая экономически не выгодная сделка для вас. Воспользуйтесь как минимум советом про кеширование из данного ответа на ваш вопрос и при качественной разработки, вам будет достаточен 1 сервер с 4 Core CPU + 8GB RAM для обработки 1000-2000 онлайн, как минимум.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question