Home>

I want to get the id in the lists but I get the error below.
How can I get it?

url = "https://api.twitter.com/1.1/lists/ownerships.json"
params = {'screen_name': user ID}
res = twitter.get(url, params=params)
li = json.loads(res.text)
print(li['lists']['id'])
[Error code]
TypeError: list indices must be integers or slices, not str


URL:GET lists/ownerships document