Search streams API causing a KeyError when looping over the "streams" list

Are you testing the HTTP code response to make sure you are getting a 200 and the data you expect. You could be seeing a 5x code or a bad JSON packet and thus no parse as you didn’t get any data or malformed.

Also in some cases the display_name can be blank. For users that have not set a dispaly_name (the display_name being a user selected capitalisation of their name).

So I think thats your problem, you are not catering for blank/unset dispaly_name's