How can I use the Twitter Search API to return all tweets that match my search query, posted only within the last five seconds?

后端 未结 5 606
迷失自我
迷失自我 2021-02-04 19:00

I would like to use the API to return all tweets that match my search query, but only tweets posted within the last five seconds.

With Twitter\'s Search API, I can use t

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 19:08

    Twitter API results are sorted by recent by default. Please see the following quote from twitter wiki :

    Parameter to Twitter search API :

    result_type: Optional. Specifies what type of search results you would prefer to receive.

    * Valid values include:
    
    
          o mixed: In a future release this will become the default value. Include both popular and real time results in the response.
          o recent: The current default value. Return only the most recent results in the response.
          o popular: Return only the most popular results in the response.
    * Example: http://search.twitter.com/search.atom?q=Twitter&result_type=mixed
    * Example: http://search.twitter.com/search.json?q=twitterapi&result_type=popular
    * Example: http://search.twitter.com/search.atom?q=justin+bieber&result_type=recent
    

    Please correct me if I am wrong anywhere.

    Thanks and Regards,
    Abhay Dandekar

提交回复
热议问题