Questions tagged [tweepy]

Tweepy is an easy-to-use Python library for accessing the Twitter API. It can be used with Python (3.7+).

Tweepy is an open source Python library for accessing the Twitter API.

The source code and documentation are available on GitHub. The library also has a community Discord server.

3361 questions
0
votes
1 answer

How to add 'tweepy' to Visual Studio Code?

I wanna write a python code to create a twitter bot app in Visual Studio Code. After importing tweepy it is not recognised. I searched tweepy in extentions but nothing was found.
Questioner
  • 662
  • 1
  • 10
  • 26
0
votes
1 answer

Can't filter tweets when using tweepy

import tweepy from tweepy.streaming import StreamingClient from dotenv import load_dotenv import os import queue import nlp_model import time load_dotenv() api_key = os.getenv('API_KEY') api_secret = os.getenv('API_KEY_SECRET') bearer_token =…
0
votes
0 answers

Using Tweepy, how to filter my search criteria by country and keyword/hashtag? (2023)

Code related to question: import tweepy import configparser import pandas as pd api_key = "" api_secret = "" bearer_token = r"" access_token = "" access_token_secret = "" # authentication auth = tweepy.OAuthHandler(api_key,…
0
votes
0 answers

Python Twitter OAuth 2.0 Authorization Code with PKCE and Tweepy V2 auth issue

I am having an issue using the Twitter V2 API with Tweepy. I have created code to refresh the Access_token once I have carried out the initial auth for the app whilst logged in. I need to use OAuth 2.0 Authorization for Twitter an have even paid the…
0
votes
0 answers

Free Twitter API, forbidden/unauthorized errors when trying to use tweepy

I'm trying to do anything at all with Twitter API v2, with not much success so far. import tweepy Client = tweepy.Client(consumer_key="...", consumer_secret="...", access_token="...", access_token_secret="...",…
UchuuStranger
  • 45
  • 1
  • 9
0
votes
0 answers

gathering data using tweepy fails

i'm working on the a udacity project wrangling data trying to gather tweets data like retweets and likes counts but this code only prints 'fail' consumer_key = 'MYKEY' consumer_secret = 'MYKEY' access_token = 'MYKEY' access_secret = 'MYKEY' auth =…
0
votes
0 answers

How do I integrate "caption" and "parse_mode" in bot.send_media_group?

I'm making a Telegram bot that posts from Twitter. I have a problem if there are two or more images in the tweet, because my code uses bot.send_photo, which, as far as I understand, is designed to send only one, or the first image. As I read, to…
Nik
  • 7
  • 2
0
votes
0 answers

Tweepy Cannot get media url

I want to show image url of tweet. I get tweet data by using get_tweet like this code. tweet_ids = [166xxxxxxxxx] tweets = client.get_tweets(tweet_ids, tweet_fields=['author_id'],media_fields=['preview_image_url']) Then I try to get list of media…
user572575
  • 1,009
  • 3
  • 25
  • 45
0
votes
1 answer

How can I fix the '403 Forbidden' error when using tweepy to access the Twitter API?

Something wrong with my tweepy API? Been trying to access the twitter API using tweepy, but getting the 403 Forbidden error. Tried the TwitterAPI and tweepy which both did not work. Researched and followed the youtube tutorials and twitter…
0
votes
0 answers

how to get tweets with tweepy?

I want get tweets with tweepy 4.14.0. I tried this code: auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) api.search_tweets(q="nasa",…
Ali Hosein pour
  • 220
  • 4
  • 19
0
votes
0 answers

Twitter API lets me tweet text but doesn't let me access information about who tagged me

After authenticating myself using tweepy, I am allowed to post tweets - however, when I try to access a list of all the users that tagged me, it throws an error saying that the app I am using must be in a project - this is despite it being in a…
0
votes
0 answers

Twitter API V2 403: Forbidden using tweepy in python

I have had issue with Twitter API V2 403: Forbidden using tweepy import tweepy consumer_key= 'XX1' consumer_secret= 'XX2' access_token= 'XX3' access_token_secret= 'XX4' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) …
0
votes
0 answers

403 Issue with twitter API v2

Recently I was learning about APIs and tried learning about the Twitter one. I authenticated my App, and even regenerated my API and the API key, yet it still doesn't seem to work. I looked up on YouTube and most of them say that I have to upgrade…
0
votes
1 answer

I cannot import Stream from tweepy

I have tweepy installed, version 4.14.0 However when I try from tweepy import Stream I obtain the error ImportError: cannot import name 'Stream' from 'tweepy' I think this was working before, has anything changed in the API?
RafaelCaballero
  • 1,555
  • 2
  • 17
  • 24
0
votes
0 answers

Python error when trying to build twitter retweet bot (using tweepy)

I'm trying to build a twitter retweeting bot that is listening to another account, but if there are any keywords in the tweet that are part of my exclusion list, it won't retweet those tweets. I'd like for this bot to retweet in real-time and not…
Machzy
  • 21
  • 1
  • 6
1 2 3
99
100