Tweepy:使用Twitter搜索API可以获得旧推文吗?

Vic*_*mer 5 python twitter json tweepy

根据http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sent Twitter搜索现在可以让您找到任何发送过的推文.

但是,当我试图使用tweepy从2014年到2015年获取推文时,它只获得最近:

    query = 'Nivea'
    max_tweets = 1000
    searched_tweets = [json.loads(status.json) for status in tweepy.Cursor(api.search,
                                                                           q=query,
                                                                           count=100,
                                                                           #since_id="24012619984051000",
                                                                           since="2014-02-01",
                                                                           until="2015-02-01",
                                                                           result_type="mixed",
                                                                           lang="en"
                                                                           ).items(max_tweets)]
Run Code Online (Sandbox Code Playgroud)

我试过="2014-02-01",而且是_id但不管怎样.

Ale*_*oVK 4

不幸的是,您无法从 Twitter 访问过去的数据。不是你使用什么库的问题:Tweepy、Twitter4J 等等,只是 Twitter 不会提供任何超过或少于 2 周的数据。

要获取历史数据,您需要直接通过 Twitter 或 GNIP 等第三方经销商访问 firehose。