[英]Twitter API doesn't return search results even though they exist
Im trying to get all of a user's tweets for a 2 month time period. 我试图在2个月的时间内获取用户的所有推文。 In search I see results but this code returns an empty array.
在搜索中,我看到结果,但是此代码返回一个空数组。 Why?
为什么?
results = api.GetSearch(raw_query="q=&from=yikyakapp&since=2014-09-24&until=2014-11-24")
print(results)
This is because Twitter search API has a limit of 7 days. 这是因为Twitter搜索API的限制为7天。 Check the API documentation
查看API文档
The Twitter Search API searches against a sampling of recent Tweets published in the past 7 days.
Twitter Search API会搜索过去7天内发布的最新Tweet样本。
There is a detailed explanation here https://dev.twitter.com/rest/reference/get/search/tweets 这里有详细的说明https://dev.twitter.com/rest/reference/get/search/tweets
Keep in mind that the search index has a 7-day limit.
请记住,搜索索引有7天的限制。 In other words, no tweets will be found for a date older than one week.
换句话说,在一周以上的日期中找不到任何推文。
In summary, you can't use Twitter API to search for tweets beyond 7 days. 总而言之,您不能使用Twitter API搜索超过7天的推文。 Of course, in the website they can show you whatever they want.
当然,他们可以在网站上向您显示他们想要的任何内容。 They hold all the data.
它们保存所有数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.