Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Twitter API v2 to retrieve Tweets longer than 280 characters?

Twitter recently allowed verified users to Tweet more than 280 characters, up to 4000. When I use the API to retrieve one of these longer Tweets I don't receive the full text - it's cut off around 280 characters. I don't see any notes about this in the Twitter API documentation, maybe I missed it. Are there any additional fields/expansions I need to request when retrieving a Tweet? Here are the fields and expansions I'm currently using (in Python):

tweet_fields_list = ["id",
                     "text",
                     "author_id",
                     "created_at",
                     "conversation_id",
                     "in_reply_to_user_id",
                     "referenced_tweets",
                     "attachments",
                     "entities"]

expansions_list = ["referenced_tweets.id", "attachments.media_keys"]

media_fields_list = ["media_key","type","url"]
like image 225
Justice Oarry Avatar asked Dec 08 '25 06:12

Justice Oarry


1 Answers

Try adding tweet.fields=note_tweet to the query to get "Information about Tweets with more than 280 characters." per the docs.

like image 60
dw1 Avatar answered Dec 11 '25 23:12

dw1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!