Hi all,
I’m using Twitter API v2 and trying to get the user object (which contains Twitter user account metadata describing the referenced user). Default values are id, name and username, but it seems only the id and text of the tweet are showing up? am i doing something wrong?
this is the case even when i use the user.fields param.
Best,
Ben
What library / code are you using? The user and tweet fields are specified with URL parameters: Using fields and expansions | Docs | Twitter Developer Platform and may end up in includes portion of the response, not in data, depending on what endpoint you’re calling.
Alternatively you can try something like twarc, that automatically requests all available information for you: twarc2 (en) - twarc
twarc2 user name TwitterDev
im using postman, its very strange. name is supposed to be a default value and then even when i use user.fields and put name it does not work. it could be something to do with the wrong credentials?
The difference is the tweet.fields Vs the user.fields. You are calling an endpoint that returns tweets, so any user details will be inside includes.users not in data, provided you specified expansions=author_id and the user.fields Using fields and expansions | Docs | Twitter Developer Platform hope that helps!