每次请求twitter的search api返回相同的结果,如何能换页


#1

https://api.twitter.com/1.1/search/tweets.json

Hello, everyone. The api interface above has a “count” parameter that represents the maximum number of results that can be returned per page per request, up to 100 results. For example, I search for “Europe” and get only up to 100 tweets related to European topics. Repeatedly calling this interface will only get the same result. How can I get more results? There is no “page” parameter on the api document. I hope everyone can help me solve this problem, thank you very much!


#2

Hello,

You can use the max_id parameter for fetching the next page of results, where the value is the id of the last tweet fetched minus one. moreover, when making a request to search/tweets.json the next_results link will be provided in the search_metadata

You can see an example here: https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets


#3

Thank you for your help! The problem is finally solved, I am really happy.


#4