A Key Error occurs when you try to access a column in the data, but it doesn't exist.
We can't fix that for you: we have no idea what the API returns.
So start with the debugger (
pdb — The Python Debugger — Python 3.12.0 documentation[
^]) and look at the actual data you are processing, work out what the column names are, and compare those with your code. At a guess, "Success" is the problem.