[API-users] Usage of endOfRecords

Tim Robertson trobertson at gbif.org
Mon Dec 22 10:49:13 CET 2014


Hi James,

The APIs will respect the limit you pass in (e.g. 20 or 50 etc) but sometimes will impose a hard ceiling on the limit (e.g. you may request 10000 but only get 1000 or less back in some APIs).  
Therefore you should always check the count returned in the response in order to know how to calculate your next offset.

Thanks,
Tim

On 20 Dec 2014, at 09:59, Nozomi James Ytow <nozomi at biol.tsukuba.ac.jp> wrote:

> Hi,
> 
> I tried
> 
> http://api.gbif.org/v1/species/search?q=Puma&rank=GENUS&limit=20&offset=0
> 
> which returns JSON starting with
> 
> {"offset":0,"limit":20,"endOfRecords":false,"count":50,"results":[
> 
> I expect that there are 50 records to be returend against the query.  Howerver,
> 
> http://api.gbif.org/v1/species/search?q=Puma&rank=GENUS&limit=60&offset=0
> 
> returns 50 records as expected, but it says  as
> 
> {"offset":0,"limit":50,"endOfRecords":false,"count":50,"results":[
> 
> Shouldn't it be true, if the returned fragment represents end of records?
> Or, shoud I check not only endOfRecords but also (limit > 0 && (offset + limit) < count)  ?
> --
> James
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> API-users mailing list
> API-users at lists.gbif.org
> http://lists.gbif.org/mailman/listinfo/api-users
> 



More information about the API-users mailing list