2

I'm trying yo get the full text in twitter search using Tweepy v2. I used search_recent_tweets(), but it returns only truncated tweets.

import tweepy
import credentials

client = tweepy.Client(credentials.bearer_token)

query = 'policy'

response = client.search_recent_tweets(query, tweet_fields = ["created_at", "text", "source"], max_results=10)

tweets = response.data
tweets[0]['text']

The output is:

"RT @saletan: I wasn't aware of this policy till it happened to my son. I told the story below.\n\nSix weeks after they locked his account, he…"

Bishan
  • 15,211
  • 52
  • 164
  • 258
  • You can use `tweet_mode='extended'` and `full_text` attribute – Bishan Sep 27 '22 at 02:32
  • In the documentacion `search_recent_tweets()` don't have the attribute tweet_mode. – Matheus Utino Sep 27 '22 at 02:35
  • 1
    This is because the Tweet is a retweet, so you need to use `expansions` to retrieve the original Tweet in an `includes` object and that should have the full Text. There is no such thing as extended Tweet mode in API v2. – Andy Piper Sep 27 '22 at 13:03

0 Answers0