Get specific occurrences
Hi all, I'm trying to get all the years of occurrence for a specific organism. I tried pagination and with the limit and offset parameters. For example:
http://api.gbif.org/v1/occurrence/search?offset=1&limit=30
But I noticed that each successive page has duplicate results. For example: for the scientific name: Aaptos aaptos, I tried limit= 30 and increased the offset parameter as-
offset=0&limit=30 and offset=1&limit=30
The two queries have 29 common results.
Is this supposed to happen or am I doing something wrong?
Thanks,
Hi Akshat, the offset is the number of records, not the pages. So yes, this is supposed to happen. For the next rpage offset should be increased by your page limit/size
best, Markus
On 17. May 2018, at 21:58, Akshat Pant <akshat26@terpmail.umd.edumailto:akshat26@terpmail.umd.edu> wrote:
Hi all, I'm trying to get all the years of occurrence for a specific organism. I tried pagination and with the limit and offset parameters. For example:
http://api.gbif.org/v1/occurrence/search?offset=1&limit=30
But I noticed that each successive page has duplicate results. For example: for the scientific name: Aaptos aaptos, I tried limit= 30 and increased the offset parameter as-
offset=0&limit=30 and offset=1&limit=30
The two queries have 29 common results.
Is this supposed to happen or am I doing something wrong?
Thanks, -- Akshat Pant Graduate Student | University of Maryland Master of Information Management _______________________________________________ API-users mailing list API-users@lists.gbif.orgmailto:API-users@lists.gbif.org https://lists.gbif.org/mailman/listinfo/api-users
Hi Akshat, the offset param defines how many items to skip before beginning to return rows. That means that to get the next page you have use offset=30 for your second request, in general you should use something like offset=0 first call: offset=1&limit=30 then: offset=(limit + previous offset)&limit=30
I hope this helps, Fede.
From: API-users api-users-bounces@lists.gbif.org on behalf of Akshat Pant akshat26@terpmail.umd.edu Date: Friday, 18 May 2018 at 06.24 To: "API-users@lists.gbif.org" API-users@lists.gbif.org Subject: [API-users] Get specific occurrences
Hi all, I'm trying to get all the years of occurrence for a specific organism. I tried pagination and with the limit and offset parameters. For example:
http://api.gbif.org/v1/occurrence/search?offset=1&limit=30
But I noticed that each successive page has duplicate results. For example: for the scientific name: Aaptos aaptos, I tried limit= 30 and increased the offset parameter as-
offset=0&limit=30 and offset=1&limit=30
The two queries have 29 common results.
Is this supposed to happen or am I doing something wrong?
Thanks, -- Akshat Pant Graduate Student | University of Maryland Master of Information Management
participants (3)
-
Akshat Pant
-
Federico Mendez
-
Markus Döring