Negative filter

The GBIF API allows us to search for occurrences and filter on, for instance, institution code. However, to the best of my knowledge, one cannot specify a negative filter. In my case, I need to exclude occurrences coming from iNaturalist as we already process those data elsewhere.

It looks like there is a way of doing so with the “download” API by specifying a predicate in the payload of a POST request. Unfortunately, this does not seem possible with the “search” API. Is there a solution to this problem with the current version of the API?

Hi @FMB there is no negative filters with the search API. This API is meant to browse occurrences quickly and isn’t compatible with this type of requests.

I suggest to use the download API if you can. This will not only allow you more flexible and complex queries but will also generate a citable DOI for the data downloaded. This is an easy way to give credit back to the publishers whose data contributed to your work.

1 Like

@mgrosjean thanks for your answer. Unfortunately, the download API does not fit our use case.

Thanks @FMB for letting us know. Would it be possible to give us a bit more context for your use case?
If you are planning to make GBIF data available via a third party platform, don’t forget to check our data user agreement and to ensure that the platform makes it easy for users to credit publishers.

We are happy to offer you some guidance on how best to do that. You are also very welcome to contact us at helpdesk@gbif.org.

Thanks for your interest. I am working on a project for CIRAD, hosted by Bioversity, which gathers observations of Musaceae recorded around the world, in the wild or in the closest to natural growing conditions. The main purpose is to obtain an as precise as possible picture of the natural geographical diversity of Musa. We began importing data from an ad-hoc iNaturalist project as well as from other sources. We recently implemented a new procedure to also import data from GBIF. I developed an interface so that researchers can browse GBIF occurrences directly from the website and decide which ones should be imported into their database (which is the reason why I developed a module for Drupal and ported part of rgbif/pygbif to PHP, which I will announce later on on this forum). Since iNaturalist data are already imported directly from the ad-hoc project and are quite numerous, there is no point in displaying them in this interface, hence the need for a negative filter.

I believe every effort is done to link imported data to the original GBIF observations and to correctly identify their authors.