No media when retreiving a list of tweets
See original GitHub issueI am trying to get a tweets from a list with its media but apparently, the media_field is not present and gives the error:
x = client.get_list_tweets(4343, expansions=["attachments.media_keys", "author_id"],
tweet_fields = ['created_at', 'text', 'id', 'attachments', 'author_id', 'entities'],
media_fields=['preview_image_url', 'url'])
and here is the error
The query parameter [media_fields] is not one of [id,max_results,pagination_token,expansions,tweet.fields,media.fields,poll.fields,place.fields,user.fields]
Any help?
Issue Analytics
- State:
- Created a year ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Retrieving media | Docs | Twitter Developer Platform
Media in direct messages must be retrieved via an authenticated app-user ... You can no longer access media via an authenticated www.twitter.com session....
Read more >Getting User tweets by twitter API call not returning media_url
I am getting tweets of a user but not getting media_url under entities in right twitter object returned, even nothing in media in...
Read more >How to Find Old Tweets: 4 Tried-And-True Methods
Learn how to find and delete old tweets, and easily remove dated or irrelevant content from your Twitter account.
Read more >The Superhuman Guide to Twitter Advanced Search - Buffer
A look at all of the powerful uses of Twitter advanced search that pros use for marketing, research, competitor analysis, sales & more:...
Read more >How to cite a tweet in APA Style | Format & examples - Scribbr
You'll list the year as “n.d.” (no date) and include a retrieval date, since the contents of the profile can change over time....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the bug report. This should be fixed now.
This was due to the Twitter API documentation for the endpoint this method uses not listing
media.fields
,place.fields
, orpoll.fields
as parameters, which got translated into Tweepy not supporting them as parameters.@phisanti I don’t see that on that page, and
place.fields
andpoll.fields
are actually missing as well.@spirale21
Client.get_list_tweets
returns aResponse
object, which doesn’t have amedia
attribute.@calvinh99 @phisanti Yes, the request URL ends up with
media.fields
as a URL parameter key, but it requires a value as well and you need to pass the parameter individually through Tweepy, not as part of a different parameter.@R2sh2 That’s not related to this issue.
Client.get_users_tweets
supportsmedia.fields
. Feel free to start a new discussion if you need help with using the parameter, but you’ll need to provide more information, like your code and expected and actual behavior.v4.10.1 has been released with this fix now.