From 564b49fa10819d10d9e4bd8903236ee605dbdb99 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 23 Oct 2021 11:11:14 -0500 Subject: [PATCH] Add FAQ section on Client.search_all_tweets per second rate limit --- docs/faq.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index ca10715..5c89a2a 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -80,3 +80,15 @@ How do I access ``includes`` data while using :class:`Paginator`? :meth:`Paginator.flatten` flattens the ``data`` and iterates over each object. To access ``includes``, you'll need to iterate through each response instead. + +Why am I getting rate-limited so quickly when using :meth:`Client.search_all_tweets` with :class:`Paginator`? +------------------------------------------------------------------------------------------------------------- + +The `GET /2/tweets/search/all`_ Twitter API endpoint that +:meth:`Client.search_all_tweets` uses has an additional 1 request per second +rate limit that is not handled by :class:`Paginator`. + +You can :func:`time.sleep` 1 second while iterating through responses to handle +this rate limit. + +.. _GET /2/tweets/search/all: https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all -- 2.25.1