James Briggs
Jan 19, 2021

--

Try printing out what each 'tweet' is. So write something like:

for tweet in response.json()['data']:

print(tweet)

The problem here is that there is no 'id_str' entry in your tweet object, which could be because the API request was not fulfilled properly, or the format is different? I don't seem to be able to replicate this on my side though, I've added another code snippet here:

https://gist.github.com/jamescalam/366dd83516b73dea3cfd10f8716bcfbb

Check that everything seems to line up, good luck, let me know what you get :)

--

--

James Briggs
James Briggs

Written by James Briggs

Freelance ML engineer learning and writing about everything. I post a lot on YT https://www.youtube.com/c/jamesbriggs

No responses yet