简体   繁体   English

即使存在,Twitter API也不会返回搜索结果

[英]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.

相关问题 获取Twitter API返回搜索结果而不是结果摘要 - Getting twitter api to return search results instead of results summary Twitter API Search App,返回某些json结果 - Twitter API Search App, return certain json results Twitter搜索API查询结果与关键字不匹配 - Twitter Search API query results don't match keyword Python findall 即使在假定的正确匹配上也不返回结果 - Python findall doesn't return results even on a supposed proper match Python Flask - 请求 object 不存在,即使它已导入 - Python Flask - Request object doesn't exist even though it's imported 我收到一个“FileNotFoundError”,指出我的目录不存在,即使它存在? - I get a “FileNotFoundError” stating that my directory doesn't exist, even though it does? Tkinter 说 pyimage1 不存在,即使它在尝试将其放在 label 上时也是如此 - Tkinter saying pyimage1 doesn't exist even though it does when trying to put it on a label 嵌套理解列表:即使在循环内,变量也不存在 - nested comprehension list: variable doesn't exist even though inside loop 终端说 computer_choice 不存在,即使它存在 - The terminal says that computer_choice doesn’t exist even though it does 为什么我有一个IO错误,说我的文件不存在,即使它在目录中也不存在? - Why does do I have an IO error saying my file doesn't exist even though it does exist in the directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM