gpt4 book ai didi

api - 有没有一种方法可以在不实际花费请求的情况下检查 Foursquare 场所的速率限制?

转载 作者:行者123 更新时间:2023-12-02 22:38:44 26 4
gpt4 key购买 nike

我目前正在对 foursquare field 平台执行 ping 操作,以协调我公司的数据与 foursquare 的数据。有关 field 协调的信息在这里:https://developer.foursquare.com/overview/mapping

速率限制在 header 中为 X_RATELIMIT_REMAINING。我有一个生产者推出新的请求和一个接触 foursquare api 的消费者。我想找到一种方法让生产者检查速率限制而不花费剩余的请求。

有谁知道这样做的方法吗?

最佳答案

不幸的是,没有“虚拟”点来检查您的速率限制。他们有一个多端点,但据我所知,他们会计算批处理中的每个请求。

你可以算一下你这边的ratelimit。这是一个解释:

The window should still update be updating in real time.

To be clear, if your rate limit is 500, at 11:00, you send 5 requests,the X-RateLimit-Remaining will be 495. If you wait a few minutes to11:05, and send another request, X-Rate-Limit remaining will be 494 --it won't have reset yet.

It's not until 12:01 that you'll get back the 5 requests that you'dmade at 11:00. So, if you request again at 12:01, your limit would be498 (-1 for the request you just did, -1 for the 11:05 request).

Requesting again at 12:06, and you'll be back up to 499 (the fulllimit, minus what you just used).

来自这个线程:API Quota exceeded

如果您重现此逻辑并计算每个端点发出的每个请求,您可以猜测您的速率限制。很抱歉,没有更简单的方法来做到这一点 :(

关于api - 有没有一种方法可以在不实际花费请求的情况下检查 Foursquare 场所的速率限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11048300/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com