Using Twitter API, I would like to fetch all images uploaded by a user who authenticated my application (OAuth). I've been digging API docs but couldn't find an easy way to do it.
Should I list all tweets, iterate over them, get every single tweet and see if it has a media entity? C'mon?
There's no specific media fetching endpoint in the Twitter API, so yes, you'd need to do something along those lines.
statuses/user_timeline.json
endpoint and page through it (supports up to 3200 Tweets). I'd suggest using the ?tweet_mode=extended
parameter, to ensure you get media entities for any longer Tweetsextended_entities
objects (these contain images or videos)