How do the /v1/controlled_terms calls work?

I tried both /v1/controlled_terms and /v1/controlled_terms/for_taxon?taxon_id=48011 to try to figure out the valid values of Life Stage for Ephemeroptera. I’m not getting it somehow … I couldn’t see from the inclusions and exclusions stated in the results of both those calls how we arrive at the four values in the menu when I’m on one of my mayfly observations.

I can supply exact inputs and outputs from my tests and get into the details later if necessary, but I hope my question is clear enough without that. Should I be able to get the list of four values from these two calls alone, or is there more to it than that?

Right now this endpoint doesn’t expand a taxon’s ancestry and you’ll need to request all taxa in the ancestry at once, e.g. https://api.inaturalist.org/v1/controlled_terms/for_taxon?taxon_id=1,47120,372739,47158,184884,48011 . It would probably be better if the method did that automatically automatically, but for now this is how it works.

2 Likes

I see. So then you just check included/excluded for each returned result for all ancestors of the taxon in question. Thanks.

If you want to see how this will be applied in Dronefly bot, see: https://github.com/synrg/dronefly/issues/86#issuecomment-640115099

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