iNaturalist API with Python : get family name from observations?

It worked for me when I swapped

for
ancestors = taxon_info.get("results", {})[0].get("ancestors", [])
(and also added a time.sleep() into get_taxon_info, and also removed the encoding from to_excel)

2 Likes