/occurrence/download/dataset/{datasetKey} Filtering

Hi everyone, newbie here, looking at the following under the API and I notice that you can only apply a limit and offset parameter, is there also a way to filter per year and or date range? Most helpful would be to use the Download->created field that you see when you get results…

tried:
https://api.gbif.org/v1/occurrence/download/dataset/{datasetKey}?year=2019,2021
( and no go)

https://api.gbif.org/v1/occurrence/download/dataset/{datasetKey}

Thanks for any help! I looked at the API documentation but could not figure it out.

Hi there,

What are you trying to achieve?

Thanks,
Daniel

Hi Daniel, thank you for your reply.

I was tasked with filtering the download results by dates, I was reading the API but I see no options for the “/occurrence/download/dataset/{datasetKey}” method.

I would like to know if I can get results using a date range. Or maybe I can get the same information that the “/occurrence/download/dataset/{datasetKey}” returns by using another method instead of the download method?

Ideally we would like to use the results->download->created key that gets returned to sort by date.

Thank again for any help :slight_smile:

There is no such option, I’m afraid. You would probably have to get all results and filter locally. Or, if it’s a one-off thing, our helpdesk might be able to do a custom query for you.

I’m still curious as to what you might need these results for? If you could tell me a bit more about the use case, I might be able to offer ideas as to what alternatives you might have.

Our curators want to be able to track download statistics using custom date ranges. Is there another method that provides the same info by using the datasetKey that is not the occurrence?

Not that I’m aware of, but I’d like to ask @mgrosjean to chip in.

Another metric you might be interested in, if you aren’t already aware, is the number of citations per dataset counted in our literature database, e.g. https://api.gbif.org/v1/literature/search?gbifDatasetKey={datasetKey}&year=2019,2021

Hi @thewalrus thanks for writing!
What you are looking for doesn’t exist but we have an open GitHub issue on the topic: Downloads per month for datasets and rollups for publishers · Issue #117 · gbif/registry · GitHub. Don’t hesitate to add your own comments there!