The default is Response but you can ask for dict instead, e.g. set return_type=dict when you make your call to tweepy.Client. This will cause your subsequent calls to return a standard python 3 dictionary. You should then be able to convert that dictionary to json using python's json.dumps:
Top comments (1)
When you get your
tweepy.Client
object, you can specify your desired return type:docs.tweepy.org/en/stable/client.h...
The default is
Response
but you can ask fordict
instead, e.g. setreturn_type=dict
when you make your call totweepy.Client
. This will cause your subsequent calls to return a standard python 3 dictionary. You should then be able to convert that dictionary to json using python'sjson.dumps
:docs.python.org/3/library/json.html
Another option is to convert the
Response
object to adict
:docs.python.org/3/library/collecti...