Hello,

what is the best and the fastest way to browse all dates for the given periodway, to get all the tweets from 01-02-2020 to 24-07-21 for example, without recovering every time 100
results and I restart the request, I want something automatic. is it possible or i have to browse the date manually because my limit per request is 100 results.

PS: I want to have all the tweets for this period with a single request and not only the last 100 tweets
# Specify the start time in UTC for the time period you want Tweets from
start_time = datetime.datetime(2018, 6, 30, 0, 0, 0, 0, datetime.timezone.utc)
# Specify the end time in UTC for the time period you want Tweets from
end_time = datetime.datetime(2018, 7, 1, 0, 0, 0, 0, datetime.timezone.utc)
# This is where we specify our query as discussed in module 5
query = “(transport OR mobilité OR déplacement) lang:fr -is:retweet” #point_radius:[lon lat radius] point_radius:[2.213749 46.227638 15mi]
#(transports, OR mobilité, OR déplacement, OR transdev, OR ratp, OR sncf, OR keolis) min_retweets:0 lang:fr until:2018-01-01 since:2018-01-01
max_results= 100
# The search_all method call the full-archive search endpoint to get Tweets based on the query, start and end times
search_results = client.search_all(query=query, start_time=start_time, end_time=end_time, max_results=max_results).

I would use twarc, it will paginate and save results and recover from rate limits and other failures for you:

Install:

pip install twarc
twarc2 configure

Save results:

twarc2 search --archive --start-time "2018-06-03" --end-time "2018-07-01" "(transport OR mobilité OR déplacement) lang:fr -is:retweet" results.jsonl

twarc2 (en) - twarc for other twarc commands and options and here for more:

thank you very much. it works for me now :smiley: :slight_smile: