Closed synrg closed 5 years ago
See https://api.inaturalist.org/v1/taxa/4892 for full output of all taxa info for the example unique match, from which much of the info specified above can be obtained.
For example, summary of wikipedia description up to a reasonable max length is results[0]["wikipedia_summary"]:
The <b>grey plover</b> (<i>Pluvialis squatarola</i>), known as the <b>black-bellied plover</b>
in North America, is a medium-sized plover breeding in Arctic regions. It is a long-distance migrant,
with a nearly worldwide coastal distribution when not breeding. The genus name is Latin and means
relating to rain, from <i>pluvia</i>, \"rain\". It was believed that golden plovers flocked when rain
was imminent. The species name <i>squatarola</i> is a Latinised version of <i>Sgatarola</i>, a
Venetian name for some kind of...
Also, there is a list of photos at various sizes, e.g. there is results[0]["taxon_photos"]["url"] which is:
A taxa lookup would be a nice 1st feature for #12 , with initial support for a unique match (w. thumbnail). Later, add paged output of matching results when not uniquely matched.
See http://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa and the by-id variant above it.
It was pointed out in #birds @ iNat Discord that the 4 letter shortcodes for birds are in iNat, so this is a twofer. Rather than coding something separately for that (e.g. see input_parsing in https://github.com/dfloer/discord-birdbot ), we could take advantage of that.
I envision:
Since this uniquely matches https://inaturalist.ca/taxa/4892-Pluvialis-squatarola it would then respond with an embed that:
Similarly, when the binomial name or taxon_id is given, it should show just the one record, e.g.
Example API call & output:
Support for user-specific regional & personal stats would be a nice future enhancement, giving something that the web doesn't directly support (i.e. user needs to navigate to "Show yours" to see those). That would require that the user authorize the bot with an API token of their own.