Whose Error Is It?
Python printed this
KeyError: 'id'
What it meansYou looked up the key id in a dictionary that does not contain it, so Python raised an exception instead of returning a default value.
The first thing to checkPrint the dict's keys to see what the data really contains, often an API response with an error body, and use .get('id') when the key is optional.