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.Clientobject, you can specify your desired return type:docs.tweepy.org/en/stable/client.h...
The default is
Responsebut you can ask fordictinstead, e.g. setreturn_type=dictwhen 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
Responseobject to adict:docs.python.org/3/library/collecti...