How to get tweets of a particular hashtag in a location in a tweepy?

前端 未结 1 726
小鲜肉
小鲜肉 2021-02-14 16:51

I wish to obtain tweets of a particular hashtag from a a particular location say Chennai for analysing data. I\'m really new to Twitter API and tweepy. I found that the search u

1条回答
  •  日久生厌
    2021-02-14 17:35

    You need to use the geocode parameter in Tweepy. Using the lat/long/radius from your search URL, your cursor should be defined like so:

    tweepy.Cursor(api.search, q='cricket', geocode="-22.9122,-43.2302,1km").items(10)
    

    See the Tweepy API.search documentation for more information on the parameters you can include in your search.

    0 讨论(0)
提交回复
热议问题