Twitter Streaming API 限制? [英] Twitter Streaming API limits?

查看:56
本文介绍了Twitter Streaming API 限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 Twitter REST API 有严格的请求限制(每 15 分钟几百次),并且流式 API 有时更适合检索实时数据.

I understand the Twitter REST API has strict request limits (few hundred times per 15 minutes), and that the streaming API is sometimes better for retrieving live data.

我的问题是,流媒体 API 的限制究竟是什么?Twitter 在他们的文档中引用了一个百分比,而不是一个具体的数量.任何见解都非常感谢.

My question is, what exactly are the streaming API limits? Twitter references a percentage on their docs, but not a specific amount. Any insight is greatly appreciated.

我想做什么:

  • 让我可以查看来自约 1000 名 Twitter 用户的最新推文(以及发布日期/时间)的简单页面.使用 REST API 似乎我会很快达到极限,那么这个应用程序是否需要流 API?

推荐答案

使用 Streaming API 应该没问题,除非大约 1000 位用户在任何时候每秒发送的推文超过(非常)大约 60 条推文.

You should be fine using the Streaming API, unless those ~1000 users combined are tweeting more than (very) roughly 60 tweets per second at any moment.

>

使用带有 follow 参数的流 API 端点 statuses/filter,您最多可以有 5000 个用户.没有速率限制,除非流返回超过当时所有推文的 1%.(每秒 60 条推文是推文平均速率的 1%,它总是在波动,所以不要依赖这个数字.)

Using the Streaming API endpoint statuses/filter with the follow parameter, you are allowed up to 5000 users. There is no rate limit except when the stream returns more than about 1% of the all tweets being tweeted at that moment. (60 tweets per second is 1% of the average rate of tweets, which is always fluctuating, so don't rely on that number.)

如果您的流确实超过了 1% 的阈值,您可以检测到这一点.(请参阅 LIMIT 通知.)然后您将使用 REST API 查找丢失的推文.

If your stream does go above the 1% threshold, you can detect this. (See the LIMIT notice.) Then you would use the REST API to find missed tweets.

这篇关于Twitter Streaming API 限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆