0

I've been using a simple json to the steam API to get player inventory, but now I have discovered that steam impose a rate limit to the number of requests allowed. A rate I feel is not enough for my requirements.

Are there any programming techniques I can use to get around or avoid hitting this limit?

Ewan
  • 75,506
Nedas
  • 131
  • This question should be on stackoverflow.com. Programmers is more about concept than application. – ahodder Mar 19 '16 at 14:56
  • 2
    @AedonEtLIRA: no, it shouldn't. Stack Overflow is not a replacement for Steam support. The author should start by contacting Steam in order to have reliable information about the limitations of their API. If there is an actual limit of 15 minutes, the OP should not seek ways to violate Steam Subscriber Agreement. – Arseni Mourzenko Mar 19 '16 at 15:35
  • The question could easily be rephrased to ask about rate limiting in general – Ewan Mar 19 '16 at 15:36

3 Answers3

2

I'll answer in the generic sense regarding how to handle getting data through an API with limits in place. Most often APIs are designed with limitations in order to discourage hitting the system with massive and inefficient requests, and to force developers to find more efficient ways of achieving the requirement. Study the API to be sure there isn't a more efficient way of achieving what you need, and if that is the case contact the API support to request either an increase in that limit, or possibly extending the API so the data points can be gathered in a more efficient manner.

I am not an expert on steam and game inventories, but it sounds like you need to have real-time up-ti-date inventories of everyone across every game? If that can't be limited to a scope of games/people that results in API traffic that doesn't break the limit, then ask for the ability to query for inventories that have changed since a date/time you provide. Then you can only ask for incremental changes.

1

If (big if!) the data that you obtain from the API changes slowly, you could cache the results, and reuse the cache for, say, 1 minute. That way you will never make more than 60*24 requests per day.

For example, if you use some API to get the current weather forecast for Paris, and two users use your app within seconds (or even minutes) of each other, there is no need to make two requests for the weather report, just one will suffice.

user949300
  • 8,823
  • but the inventories are different to each player and might change any minute. – Nedas Mar 19 '16 at 18:52
  • @nedas you dont say what you are trying to do with the api – Ewan Mar 20 '16 at 19:39
  • @Ewan I actually wrote what I want but moderator renamed my topic and changed it. I'm trying to retrieve player's inventory – Nedas Mar 21 '16 at 13:10
  • that was me, I know you are trying to get the inventory, but why do you need to do it 100,000 times a day? thats every 0.8 seconds – Ewan Mar 21 '16 at 14:09
0

So, reading the api tncs for steam it seems you are limited to 100,000 requests per day and can ask for that limit to be increased.

In general these type of limits are imposed by issuing api keys, not by ip address. So in theory you could get more than one key and double your rate.

However, the rates are in place for a reason, it costs money the run the servers and if you load them indescriminatly without paying per request you should expect to have your api key cancelled.

You should see there are other ways to produce the effect you want with out having to use so many requests. For example many services will offer push models, which reduce the need for polling and hence the number of requests

Ewan
  • 75,506
  • 2
    Many API's also offer bulk-polling which counts as a single poll for the rate-limit, don't know about the steam-api though – tkausl Mar 19 '16 at 16:05