Closed scott97 closed 3 months ago
I propose we add a new API to import species from inaturalist. This API would be for Admins only and could be used periodically to keep our species list up to date.
POST /api/v1/species/import-inaturalist?descendants_of=Infraorder Cetacea,Order Sphenisciformes,Class Holocephali etc
This API will use the provided name and rank(s) to query the inaturalist API for species and insert these species into the datastore.
In our datastore, we will store the inaturalist taxon id if a species is imported. When that species is imported again, we can search by this id and can update that species instead of creating a new one.
POST /api/v1/species/import-inaturalist?descendants_of=Infraorder Cetacea&preview=true
This API would provide information about what will be inserted and updated but not perform the action.
https://www.inaturalist.org/pages/api+recommended+practices
Key points:
User-Agent: openfish
Maintaining a list of species in our database would involve a lot of work. Potentially we could use inaturalist's API to fetch a list of species and their images. To get the most popular species we can make a query like so:
In this query the taxon ID is used to filter to only show its descendants. Combined with rank=species it can find all the species within that category. We will need to make multiple queries and merge the results to get a satisfactory list of marine life. This is because marine animals do not fit neatly into one category.
Vertibrates
Within the vertibrates, I think we should include all within:
Within Birds Class Aves
Within Mammals Class Mammalia
Within Reptiles Class Reptilia
[x] - Crocodilians Order Crocodylia
[x] - Sea Turtles Superfamily Chelonioidea
sea snakes would require more research
Within Amphibians more research needed
Invertibrates
more research needed
Species API and caching
Since there are many species, and a bit of work merging the results of multiple requests, it would be best to cache the info we need in our datastore, omitting the data that we don't need.
Sources: