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

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

问题描述

我了解Twitter REST API具有严格的请求限制(每15分钟几百次),并且流API有时对于检索实时数据更好.

我的问题是,流API的限制到底是什么? Twitter在其文档中引用了一定百分比,但未指定具体百分比.任何见解都将不胜感激.

我要做什么:

  • 一个简单的页面,我可以查看约1000个Twitter用户的最新tweet(及其发布的日期/时间).似乎我将使用REST API迅速达到极限,那么此应用程序是否需要流API?

解决方案

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

使用带follow参数的Streaming API端点statuses/filter,最多允许5000个用户.除速率限制外,没有任何限制,除非该流返回的时间超过了当时所有被发布的所有推文的1%左右. (每秒60条推文是平均推文率的1%,该数字总是在波动,因此请不要依赖于该数字.)

如果您的视频流确实超过了1%的阈值,则可以检测到这一点. (请参阅 LIMIT 通知.)然后,您将使用REST 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.

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.

What I'm trying to do:

  • Simple page for me to view the latest tweet (& date / time it was posted) from ~1000 twitter users. It seems I would rapidly hit the limit using the REST API, so would the streaming API be required for this application?

解决方案

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.

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.)

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天全站免登陆