Occurrence inventory for species

I would like to create a checklist of species based on a taxon key and a country code, from the API, for use in a demo web app. This is nearly possible in several distinct ways, but never entirely:

  • Occurrence metrics can show counts by species (optionally filtered by country), but only one species at a time (and without being able to list all occurring species).
  • Occurrence inventories show occurrence counts (optionally filtered by country and parent taxon) split by year, dataset etc., but not split by species.
  • Such species lists can be downloaded, but this requires creating downloads (which is too overkill and permanent for my purposes) and requires logging in (which is not ideal in the web app).
  • There is an internal API path to do this, e.g. https://www.gbif.org/api/occurrence/breakdown?advanced=false&country=BE&dimension=speciesKey&taxon_key=10501569 for BE (Belgium) and 10501569 (Chrysis), but this path cannot be used outside of the GBIF domain due to Cross-Origin Resource Sharing and has no equivalent in the public API as far as I can tell.

Is this possible in some way I have not found? If not, can I request adding support for a taxonKey (or speciesKey) property to the Occurrence Inventories API?

I can understand something like this having performance reasons but I hope that is not the case here, as it is already supported in the internal API.

Hi @larsgw the easiest would probably be to use the facet parameters of the occurrence/search (GBIF occurrence API).
For example: https://api.gbif.org/v1/occurrence/search?country=BE&taxon_key=10501569&limit=0&facet=scientificName&facetLimit=100
You can page through the facets by using the facetLimit and facetOffset parameters. You can also choose a different facet than scientific name and you can even work with multiple facets.

Is this what you had in mind?
Let us know, thanks!

Thank you. This is, again, nearly what I was hoping for. In my use case I would like to compare the checklist against various lists of GBIF species identifiers (extracted from identification keys) to find the best match, but the facets returned here don’t seem to have the GBIF identifier of the species unfortunately. I could try to map the GBIF IDs in the lists from the keys to species names to match them that way but I’d be worried about multiple distinct species with the same label (though I’m not sure if that happens much in the backbone).

Hi @larsgw, you can choose the facet to get the taxonKey instead: https://api.gbif.org/v1/occurrence/search?country=BE&taxon_key=10501569&limit=0&facet=taxonKey&facetLimit=100
or the speciesKey: https://api.gbif.org/v1/occurrence/search?country=BE&taxon_key=10501569&limit=0&facet=speciesKey&facetLimit=100
Would that work?

Oh I see, that’s perfect. Thank you!

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