[API-users] dataset activity api request paged by date
sant.herbarium at gmail.com
Fri Feb 10 18:15:55 CET 2017
I just want to use the api to maintain a short summary of our datasets
usage along time. I could run a script regularly to keep a local file
updated (a table with just a couple of columns: download date and
number of records downloaded).
But I am facing this problem: the api returns first the LAST download
event (the most recent one). So the offset value is not a valid
permanent pointer to any download event.
This difficults paging, specially if you want to space your requests
every week or so.
How would I know the offset value for my next request, so I don't
inject duplicated records to my local file?
This would be much easier to circunvent if the api returns download
events in reverse order. So, offset=0 would be the first download
event (happened years ago), and offset=3348 would always point to the
same download event, whenever it happened.
So, the offset to use for each new request should simply be the
current total number of records I have already in my local file. No
risk of duplicated results.
Would it possible to introduce an "order=reverse" option in the api,
so records could be get returned in the opposite order?
Thanks a lot
On 7 February 2017 at 14:19, Matthew Blissett <mblissett at gbif.org> wrote:
> Hi David,
> This API method is documented here:
> There are no search or filtering parameters accepted, only the paging
> parameters 'limit' and 'offset'. The data portal URL uses that API call,
> but itself is just displaying this information, and paging through it.
> We've experimented with showing a chart for query terms on the demo site, we
> will consider adding a chart for year of download. Is this related to what
> you're working on?
> On 05/02/17 16:06, Herbario SANT wrote:
>> Where can I find a list of all possible api parameters for this api
>> It looks similar to the data portal "dataset download activitiy" url,
>> which uses an offset parameter for paging download activity using the
>> links at the end of the page.
>> But ... what other filtering options are there when using the api?
>> I wonder if there is a way to request activity related to a certain
>> date or date range (or to a single year, month). Some examples:
>> Of course, I am meaning the "download date", not the "occurrence date".
>> Thanks a lot for your help.
> API-users mailing list
> API-users at lists.gbif.org
David García San León
Universidade de Santiago de Compostela
More information about the API-users