http and apis — making the call3 / 9
get, status, json — the call ai makes 100 times a day
response.json() is just a Python dict
Every real API call ends the same way: you parse the body and dig into a nested dict.
The pattern AI uses constantly:
data["name"]— top-level fielddata["roles"][0]— first item of a list fielddata["org"]["slug"]— nested dict access
If the field is missing, you get a KeyError. If a list is empty, you
get an IndexError. Both are common in the wild — APIs add and remove
fields between versions, and AI code rarely accounts for that.
Run the editor. Three different access patterns on the same user shape.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _