Reputation: 303
I've been trying to figure out the Twitter API v2 so I can pull the Profile Image URL of a specific username/ID, but I am not having any luck.
Here's my code. Anyone know where I'm going wrong?!
import tweepy
client = tweepy.Client(bearer_token='bearer')
tweets = client.get_user(username = 'jack', user_fields=['profile_image_url'])
print(tweets)
Response:
Response(data=<User id=12 name=jack username=jack>, includes={}, errors=[], meta={})
Upvotes: 1
Views: 1180
Reputation: 11
try with user id's instead
user_ids = [2244994945, 6253282] #TwitterDev&API profile images
tweets = client.get_user(ids = user_ids, user_fields=['profile_image_url'])
Upvotes: 1