When I run your script ,I get the error as follow: for item in temp['data']['durl']: KeyError: 'durl'