Jim
Jim

Reputation: 353

Avoiding Error 429 Too Many Requests (Steam Web API)

I'm trying to make a site that displays information obtained from the Steam Web API but while testing, I received a 429 error. There is no indication for how long until I can make another request and its been over 3 hours. I've read that there is a 100,000 daily call limit but I didn't reach anywhere near that number.

The information I was trying to receive was the profiles of all my friends (around 100) to get their profile picture as well as the games I have recently played and their achievements. The information is called every time someone visits a web page and I was using a live server while working on the site (it made requests every time I saved and the browser reloaded). I'm guessing I might have made to many calls to quickly but is there a better design to approach what I am trying to do?

Upvotes: 5

Views: 12348

Answers (1)

Jim Grimmett
Jim Grimmett

Reputation: 670

The 100,000 a day is from the Steam API Terms and Conditions however, it seems that Steam estimates the rate over shorter periods. If you google around you'll see that many people limit the calls on a 5-minute bucket to around 200 per 5-minutes.

Certainly the way we do it is to define a bucket and every time a call is made, increment a counter. If the counter hits the limit for that bucket, we pause any new calls until the next bucket.

If you were making a call for the profile, played games and achievements for 100 people in a short period of time that may push it over the limit.

When a 429 is returned you may find More information about when you can call next in the headers.

Upvotes: 2

Related Questions