Registry API bug

Hi!

I have noticed there is a bug in the Registry API endpoint https://api.gbif.org/v1/dataset (documented here Registry API :: Technical Documentation). According to the documentation the parameter modified should support wildcards in the form of omitted values, for example &modified=2024-09-10, or &modified=,2024-09-10.

You can see that when comparing output for https://api.gbif.org/v1/dataset?type=occurrence&modified=2024-09-10,2024-10-18, which returns 1961 results, and https://api.gbif.org/v1/dataset?type=occurrence&modified=2024-09-10, which returns 20 results, we would expect it to return an equal or larger amount of results, as it has the open end of the range.

The form https://api.gbif.org/v1/dataset?modified=,2024-10-18 does not work at all and returns status 400.

Additionally, the data parameter seems to be accepted as and expecting year-moth-day (throws an error if I try with 13 for month) but processed on the server when returning results as year-day-month. This could explain the issues above.

Thanks for your help!
Stanley
ICL

Thank you for reporting the issue! I have created an issue in the registry repository on GitHub so the Informatics team can investigate.

From modified parametre bug · Issue #639 · gbif/registry · GitHub

A * to mark the end of the range is required, unfortunately it has been converted to italic text in the documentation. This will be fixed in the next release.

20 results for https://api.gbif.org/v1/dataset?type=occurrence&modified=2024-09-10 or https://api.gbif.org/v1/dataset?type=occurrence&modified=2024-09-10%2C (trailing comma escaped so GitHub links correctly) are the ones modified on that day only.

https://api.gbif.org/v1/dataset?type=occurrence&modified=2024-09-10%2C* (trailing ,*) has 7909 results.

https://api.gbif.org/v1/dataset?type=occurrence&modified=*%2C2024-09-10 has 41929 results.

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