api icon indicating copy to clipboard operation
api copied to clipboard

Requesting next 100 records

Open alex-webb opened this issue 4 years ago • 5 comments

What is the best way to to continue your search from where you left off (i.e. 100 records on, like for pagination)?

I know you can request by date but this would leave gaps. I think the native API allows you to start at an ID where it will continue from there?

alex-webb avatar May 20 '21 15:05 alex-webb

It's probably inefficient but I've started by querying by hour and then exponentially increasing the span when no results come back. Then when results come back I rest the span to 1 hour.

edsu avatar Jul 13 '21 21:07 edsu

Yea, a pagination feature would be nice

AlbertoSamele avatar Dec 31 '21 01:12 AlbertoSamele

+1 Is there any better way to paginate, other than requesting by hours?

aaronsnoswell avatar Feb 17 '23 01:02 aaronsnoswell

Update; I found this comment which is a good idea. I'm also trying the psaw library which seems to handle all of this under the hood.

aaronsnoswell avatar Feb 17 '23 01:02 aaronsnoswell

I paginate results by taking records before the earliest timestamp of the previous results - e.g. this in the query string:

...&size=100&before=1676374987

alex-webb avatar Feb 17 '23 14:02 alex-webb