Species search by datasetKey not working

Works for one dataset: https://api.gbif.org/v1/species/search?datasetKey=2d59e5db-57ad-41ff-97d6-11f5fb264527

…but not for the one we need: https://api.gbif.org/v1/species/search?datasetKey=83fdfd3d-3a25-4705-9fbe-3db1d1892b13

Why could that be?

Hi @barbalex I also sent you an email (sorry didn’t see you wrote here).

I will paste the same message in case someone else is wondering the same:

The different API calls you mentioned have different purposes, use different parameters, and will give you different outputs.

The dataset mentioned is an occurrence dataset, not a checklist dataset. This means that you will only be able to access its records via the occurrence API (search or download). The species suggest or species search API will be for accessing records from checklist datasets like the ones listed here. Learn more about the species API here.

There are two ways to get a list of species for which you have occurrences in a given dataset:

  • The one I would recommend is to generate a download with the download API and to select the “SPECIES LIST” format.
    • The occurrence download is an asynchronous system, which means it doesn’t have any limit in terms of records queried.
    • In addition to that, it will give you one citable DOI, which will make citing the data much easier later (see our citation guidelines).
    • You could select one or several datasets at the same time and choose to download occurrences instead (see the “SIMPLE CSV” download format). This will allow you to generate your own lists.
  • You could also use an occurrence search query with facets. For example: https://api.gbif.org/v1/occurrence/search?dataset_key=83fdfd3d-3a25-4705-9fbe-3db1d1892b13&limit=0&facet=speciesKey (you would have to page through the results with the facetOffset parameter)

I suggest checking our Data Use Club recorded webinar for an introduction to our API.

1 Like

@mgrosjean Thanks so much. Am now watching the introduction. Sorry for first sending an email, I only found the forum later via a web search.

1 Like