简体   繁体   中英

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?

The 100,000 a day is from the Steam API Terms and Conditions however, its 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.

Certainoly the way we do it is 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 proifile, 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 abotu when you can call next in the headers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM