Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 搜索操作期间的速率时间限制错误_Java_Twitter4j - Fatal编程技术网

Java 搜索操作期间的速率时间限制错误

Java 搜索操作期间的速率时间限制错误,java,twitter4j,Java,Twitter4j,当我尝试使用twitter4j通过搜索(sports+exclude:retweets)等关键字来获取公共推文时,我遇到以下错误: 420:Returned by the Search and Trends API when you are being rate limited (https: //dev.twitter.com/docs/rate-limiting). Returned by the Streaming API: Too many login atte

当我尝试使用twitter4j通过搜索(sports+exclude:retweets)等关键字来获取公共推文时,我遇到以下错误:

420:Returned by the Search and Trends API when you are being rate limited (https:
    //dev.twitter.com/docs/rate-limiting).
    Returned by the Streaming API:
     Too many login attempts in a short period of time.
     Running too many copies of the same application authenticating with the same acc
    ount name.
    {"error":"You have been rate limited. Enhance your calm."}
    Relevant discussions can be found on the Internet at:
            http://www.google.co.jp/search?q=d35baff5 or
            http://www.google.co.jp/search?q=0877c84f
    TwitterException{exceptionCode=[d35baff5-0877c84f], statusCode=420, retryAfter=51
    1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.6}
            at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:185

    - Unable to search keyword = Query{query='sports OR +exclude:retweets', lang='n
    ull', locale='null', maxId=-1, rpp=-1, page=15, since='null', sinceId=-1, geocode
    ='null', until='null', resultType='null'} You have been rate limited. Enhance your calm

有谁能告诉我,为什么我只是在做一个搜索操作的时候才得到这个消息?API有什么问题吗?

看起来就像错误所说的那样,您受到了速率限制。你是不是连续运行这个太多次了?您的连接频率是否超过需要