Python JSON TypeError list indices must be integers or slices, not str

data['result']['results'] is an array so you can’t do ['name'] you need an int, you could add [0] after['results'] and it should work. Then you can reference keys within the object in results.

Leave a Comment