API: How to get taxon info by name for a subspecies or variety

When I use the API to get taxon info by name for a subspecies or variety such as “Agoseris glauca glauca”, the repeated part of the name causes lower-quality results. E.g.

https://api.inaturalist.org/v1/taxa?q=Agoseris%20glauca%20glauca&rank=variety

The above URL returns four results, with “Agoseris glauca dasycephala” being the first.

Is there some better way to construct the GET, or do I need to increase the per_page value and then parse through all of the results for the desired name?

it’s hard to judge “better” without understanding what you’re trying to do exactly, but there are other ways to get taxa based on name from the API:

also, the DWCA taxon export contains names both scientific and common names, and the taxon metadata file from the AWS Open Data Set contains scientific names. (just do a search in the forum for more information.)

Thanks for that. The ‘taxa/autocomplete’ API may be what I need at the moment. I’d convinced myself that it was also returning results out of order, but perhaps not.

And thanks also for the DWCA pointer. Somehow I missed that when I eyeballed the list of available bulk data. I can probably use that for the majority of names and then only touch the API for missing/updated names.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.