且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

避免错误 429 请求过多(Steam Web API)

更新时间:2022-06-07 23:26:20

每天 100,000 个来自 Steam API条款和条件 但是,Steam 似乎在较短的时间内估计了费率.如果您在 google 周围搜索,您会发现许多人将 5 分钟内的呼叫限制为每 5 分钟 200 次左右.

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.

当然,我们的做法是定义一个bucket,每次调用都会增加一个计数器.如果计数器达到该存储桶的限制,我们将暂停任何新调用,直到下一个存储桶.

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.

如果你打电话给个人资料,在短时间内为 100 人玩过游戏和成就,可能会超过限制.

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.

当返回 429 时,您可能会找到更多关于何时可以拨打 next 的信息标题.

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