0

I am using Tweepy library for the Twitter API. My purpose is getting data per hour for a day. For example, 08.19.2019 17.00 - 18.00. This is the time range. And i want to access all tweets at this time range.

search_words = 'bitcoin -filter:retweet'
date_since = '2019-08-15'
date_until = '2019-08-16'

tweets = tw.Cursor(api.search,
              q=search_words,
              lang="en",
              since = date_since,
              until = date_until).items(100)

There is some parameters like date_since, date_until. How can I do this hourly?

Mert Yanık
  • 164
  • 1
  • 1
  • 9
  • Possible duplicate of [Twitter API tweets for time range](https://stackoverflow.com/questions/7655403/twitter-api-tweets-for-time-range) – Sagar Gupta Aug 19 '19 at 15:15
  • No, this is not the answer. – Mert Yanık Aug 20 '19 at 08:08
  • Please elaborate. – Sagar Gupta Aug 20 '19 at 12:07
  • 2
    There is no such param in the Twitter public API to set a specific time range. Please read https://developer.twitter.com/en/docs/tweets/search/guides/standard-operators.html and https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html – JeffProd Aug 20 '19 at 14:40
  • AS @JeffProd mentioned there is no such param to set a specific time range. You would have to keep fetching till you get to the time range and process accordingly. Moreover the Search API is not complete index of all tweets, but instead an index of recent Tweets. The index includes between 6-9 days of tweets. – Sheikh Azad Aug 21 '19 at 13:28

0 Answers0