unable to get username when using StreamingClient in v2/4.9.0 #1885
-
I am trying to get the username of the author of the original tweet when fetching tweets via StreamingClient in v2 of twitter API. But I dont see the username field when I try to print Here is the code and the response I am getting:
I am able to get the username when requesting the data directly via Curl:
How can I get the username of the user?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You'll need to use
See Tweepy's documentation on expansions for more information. |
Beta Was this translation helpful? Give feedback.
You'll need to use
StreamingClient.on_includes
orStreamingClient.on_response
.StreamingClient.on_tweet
only gets passed the Tweet in thedata
field, and as you can see, the User object is in a separateincludes
field.See Tweepy's documentation on expansions for more information.