"Convert" IUCN taxon ID to iNat ID?

IUCN makes a call to the iNat API with the name of the taxon, e.g. https://www.inaturalist.org/observations.json?has[]=photos&limit=20&order=desc&order_by=observed_on&taxon_name=Calidris+pugnax&q=Calidris+pugnax.
It uses this to return the photos, but it also sets the link out to iNat using the taxon_id from the first returned result.

You can see that from the behavior for Ficus variegata. The API call is https://www.inaturalist.org/observations.json?has[]=photos&limit=20&order=desc&order_by=observed_on&taxon_name=Ficus+variegata&q=Ficus+variegata. This is a problem because iNat has two different taxa with the identical name Ficus variegata and if you give a non-unique name to the parameter taxon_name, it will just return everything. So that parameter does nothing to narrow down the results for this case and instead the call is relying entirely on q=Ficus+variegata, which will search the taxon name, but also the notes, tags, and the place description. It turns out the first result from this API call is an observation with the description “斑叶高山榕Ficus altissima cv. Variegata.” – iNat has this
observation not as Ficus variegata (taxon_id=343952), but as Ficus altissima (taxon_id=162968).

And the link out to iNat uses this incorrect F. altissima ID.

So IUCN isn’t storing the taxon_id anywhere, it’s just looking it up by name via iNat’s API at the time you load the images.

3 Likes