gbif / gbif-api

GBIF API
Apache License 2.0
27 stars 5 forks source link

simple question: /species #82

Closed SenCodeMaker closed 9 months ago

SenCodeMaker commented 3 years ago

Hello thank you for this beautiful service.

I'm building an application that will show picture of species in cards showing some information from the API for a non scientific public (canonical and vernacular name, maybe geographic place, ...) . I see /species allows to give a specieId to get its info but where do i get the specieId I want to query ?

I suppose I have to download the complete catalogue in order to make the link between a specie and its id. If that's the case what's the best way to do that ? I can build a java batch to loop and save the json results.

I'm also interested in having a way to query for species in a country, a region or in some family, phylum, etc. I understand I can do that woth the Rank Enum can you give me an example ? I'm confused by the docs.

ManonGros commented 3 years ago

Hi @SenCodeMaker

You could try to use the species Match API. More information here: https://data-blog.gbif.org/post/gbif-species-api/

An alternative could be to download and use the GBIF backbone taxonomy (see the download button) the IDs should correspond to the speciesIDs.

mdoering commented 3 years ago

... or use the species search API with datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c

SenCodeMaker commented 3 years ago

merci Manon ! Merci pour la réponse rapide elle m'a bien aidé, j'ai pas répondu plus vite j'étias en train d'analyser les fichiers CSV

Thx you for your quick answers ! I was going through the CSV files I think the Taxons.tsv will be perfect for me i will feed it to a java batch and retrieve randomly some taxondId of different species to show them.

So for the image I can put in the card how can i obtain them for a specie ? Like the one we see in a presentation page like this (https://www.gbif.org/species/2488385). I tried to see the network calls in the inspector but they seems to be hard coded into the html.

ManonGros commented 3 years ago

Avec plaisir @SenCodeMaker ! The images come from the occurrences whose scientific name matched the species (taxon). For example, those are all the images for occurrences associated with the taxon Pseudoscorpiones: https://www.gbif.org/occurrence/gallery?media_type=StillImage&taxon_key=1161 You can access the link to the images by using the occurrence API (search or download). Here is an example: https://api.gbif.org/v1/occurrence/search?media_type=StillImage&taxon_key=1161 The link to the images can be either in the extensions or media or associatedMedia fields (more information on this blogpost: https://data-blog.gbif.org/post/gbif-multimedia/

Keep in mind that you will have to check the licenses associated with the images before integrating them in your app. The license of an image can be different from the license of an occurrence record.

In general it is important to cite the data you use properly, for more information, please check the GBIF citation guidelines: https://www.gbif.org/citation-guidelines