速率限制Twitter API

速率限制Twitter API,twitter,Twitter,我对这里提到的速率限制有点困惑 在他们的指南中,twitter提到了follow字段将出现在响应标题中,该字段可用于确定允许的api调用量,并将停留在info X-Rate-Limit-Limit: the rate limit ceiling for that given request X-Rate-Limit-Remaining: the number of requests left for the 15 minute window X-Rate-Limit-Reset: the rem

我对这里提到的速率限制有点困惑

在他们的指南中,twitter提到了follow字段将出现在响应标题中,该字段可用于确定允许的api调用量,并将停留在info

X-Rate-Limit-Limit: the rate limit ceiling for that given request
X-Rate-Limit-Remaining: the number of requests left for the 15 minute window
X-Rate-Limit-Reset: the remaining window before the rate limit resets in UTC epoch seconds
现在,他们还提供了一个速率限制状态api来查询

https://dev.twitter.com/docs/api/1.1/get/application/rate_limit_status

现在我有点搞不清应该遵循上面哪一个值来查看在达到所需限制之前有多少api调用可供我使用。

两者似乎返回相同的值。虽然是一个API调用,返回所有资源的速率限制,但X-rate-limits为您刚才调用的资源设置头

用于缓存剩余的API调用数,定期刷新,而不必进行调用,然后解析标头信息以检查是否超过速率限制