tweepy

Get Tweet Id using Tweepy TwitterV2

Get Tweet Id using Tweepy TwitterV2 Question: I am trying to make a bot which makes a post and then self replies. The only issue I am having is that response.id is not fetching the tweet id. Could I get any pointers as to the right way to fetch the id of a tweet that …

Total answers: 1

How to include embedded links in tweet with tweepy?

How to include embedded links in tweet with tweepy? Question: I’m trying to create a program that will download tweets from a user timeline as per Client.get_users_tweets method and look for external links inside those tweets. From what I could gather, these objects reside into the entities field, but so far my query author_id = …

Total answers: 1

How to retrieve data from a dataframe with multiple conditions

How to retrieve data from a dataframe with multiple conditions Question: I am trying to extract data from a data frame base on condition. I need to get only values having only fans or the Top 0.10% in the data frame. I am able to get the value using the if condition:- for i in …

Total answers: 1

Tweepy for Twitter API v2 – Python List

Getting frequency of followers in subset of followers Question: I am creating a python twitter bot using Tweepy. In this snippet of code I am grabbing a list of recently followed accounts (50 per twitter user checked). while count < int(numOfIDs): print(twitterUsernameArray[count] + " follows these accounts:") response = client.get_users_following(id=twitterIDArray[count], max_results=50, user_fields=[‘username’]) for user in …

Total answers: 1

Can't query Twitter API v2 with elevated acces project/app

Can't query Twitter API v2 with elevated acces project/app Question: I’m trting to query twitter API v2 with elevated research access via tweepy, but it still gives me a 403 Forbidden. client = tweepy.Client( bearer_token=BEARER_TOKEN, # consumer_key=CONSUMER_KEY, # consumer_secret=CONSUMER_SECRET, # access_token=OAUTH_ACCESS_TOKEN, # access_token_secret=OAUTH_ACCESS_TOKEN_SECRET, ) test = client.search_all_tweets(query="#something", start_time = "2023-01-01") print(test) Response: Forbidden: 403 Forbidden …

Total answers: 1

How Does the api.get_retweeter_ids() Actually Work (Tweepy Python)?

How Does the api.get_retweeter_ids() Actually Work (Tweepy Python)? Question: I am really new to twitter api, and I’ve been trying to get a list of IDs of everyone that retweeted a specific tweet. After several attempts i can’t get the ‘api.get_retweeter_ids’ to get every id. It always seems to get a few. I know there …

Total answers: 2

Tweepy API: unable to get queries to return user_fields

Tweepy API: unable to get queries to return user_fields Question: I’ve got a python flask app whose job is to work with the Twitter V2.0 API. I got to using the Tweepy API in my app because I was having difficulty cold coding the 3 legged auth flow. Anyway, since I got that working, I’m …

Total answers: 2

Searching twitter BIO's – but not getting any results back

Searching twitter BIO's – but not getting any results back Question: when I start my code, it doesn’t return any results, any idea what could be going wrong? I have it searching a yaml file with around 15~ keywords, and if it finds profiles with these keywords, it will notify me of their username + …

Total answers: 1

Retrieve viral tweets topic from Twitter API

Retrieve viral tweets topic from Twitter API Question: I’m trying to retrieve viral tweets for an academic project using the Twitter API v2. There is a Topic on Twitter called "viral tweets" which is perfect for what I want. It has id 1284234742661963776 so my thoughts was to query using context annotations. However there is …

Total answers: 1

'str' object has no attribute 'user'

'str' object has no attribute 'user' Question: I am trying to get some tweets using Tweepy library, but I am receiving this error AttributeError: ‘str’ object has no attribute ‘user’ I used this same code some months back and I didn’t encounter this error, I don’t know why I am receiving this. Here is the …

Total answers: 1