AttributeError: 'API' object has no attribute 'get_place_trends Tweepy

Viewed 46

I am using this to get a list of trending hashtag in twitter.

import tweepy
 
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
 
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
 
auth.set_access_token(access_token, access_token_secret)
 
api = tweepy.API(auth)
 
woeid = 44418
trends = api.get_place_trends(id = woeid)
 
print("The top trends for the location are :")
 
for value in trends:
    for trend in value['trends']:
        print(trend['name'])

It is producing this error: AttributeError: 'API' object has no attribute 'get_place_trends'. I looked at the documentation https://docs.tweepy.org/en/stable/api.html#get-trends-near-a-location But I am still unclear why I am getting this error. Could you please what this error means?

0 Answers
Related