so here requests.get() will return requests.models.Response object , and you cant cast to string directly use requests.models.Response.content , in our case response.content and convert to string by str() function so it become str(response.content )
following working python code to make json file from live api call by requests :