Resource for taxon_id and taxon_name data for descendants of higher-order taxa

47 views
Skip to first unread message

Jeff Oliver

unread,
Aug 23, 2017, 1:35:54 PM8/23/17
to iNaturalist
First of all, the API is excellent, and the documentation is great.

I would like to know if there is a resource where I could find the mapping of taxon_id to taxon_name for all species in a particular group of taxa (for my purposes, I am interested in Papilionoidea [taxon_id = 47224] & Hesperioidea [taxon_id = 47654]). That is, is there any way I could get a csv of taxon_id and taxon_names for these two groups? I could imagine some involved hackish use of the API (maybe there is a way to do this with the API, but I could not find it; I tried using observation/taxon_stats, but could not get more than counts), but figure there is an SQL table or something of that ilk lying around with those data...

Cheers,

Jeff

Patrick Leary

unread,
Aug 29, 2017, 12:04:34 PM8/29/17
to iNaturalist
Thanks Jeff! As you can see from the documentation http://api.inaturalist.org/v1/docs/#/Taxa , there aren't a lot of API methods focused around taxa. Most are observation- and identification-focused with taxa as metadata. One thing you could do is just crawl through the taxa - fetch one of your clades (e.g. http://api.inaturalist.org/v1/taxa/47224), and recursively fetch each child, and their children etc., until you have all the species in the clade. You wouldn't need to make a call for each species since they would be in the children list when you fetch their parent. So it looks like that would take 1575 API calls for Papilionoidea to fetch its 12173 taxa, and 400 API calls for Hesperiidae (Hesperioidea is now inactive) to fetch its 2290 taxa.

Alternatively, you might find the export we create for GBIF helpful https://www.gbif.org/dataset/50c9509d-22c7-4a22-a47d-8c48425ef4a7 . It contains only the research grade observations with appropriate licenses, but it has all the relevant taxon information in easy-to-use formats. But since it only returns taxa associated with observations, it would not give you a complete taxon list.

Other than that, I'm not sure there is anything available that would return a machine-readable complete species list including taxa not associated with iNaturalist observations. But if you have any requests, please feel free to make a ticket in our API GitHub repository https://github.com/inaturalist/iNaturalistAPI/issues .

- Patrick
Reply all
Reply to author
Forward
0 new messages