Hi Gabor,
Thanks for writing in to raise this.
Among the goals of this new API is that we should be making it
strictly faster to fetch large datasets, so the issue that you bring
up is certainly germane to what we're trying to support here. I
actually think (and I'd be happy to do some of my own benchmarking to
prove/disprove) that for, eg, sucking down 100,000 charges on a
merchant, a single thread using this newstyle API will beat a
threadpool pounding the oldstyle API sliced by offset.
Another thing that I'll say is that the offset parameter is not going
away. It is undocumented now to nudge people in the direction of the
newstyle API, a decision that we can reverse if it causes too much
confusion. But we absolutely intend to support it indefinitely for
backwards compatibility reasons. So whatever reason(s) that you have
for needing offset, either as part of a transitional measure or even
as part of your final implementation, we will happily support. Offset
"composes" with `starting_after` in that asking for
`starting_after=ch_foo&offset=1000` will give you the thousandth
charge after `ch_foo`.
It's an interesting suggestion for `count` to return the object count
after `starting_after`. We want `starting_after` to be very obviously
a *pagination parameter* as opposed to a *filter*, so we didn't want
it to affect the total count returned (in the same way that increasing
the offset wouldn't affect the count returned). However, I could see
the value in being able to request the `remaining_count` of objects
after object `starting_after`. This is something that I'll float with
the team here.
Finally, I want to mention that while I feel that this API does indeed
make things incrementally better for the "suck down all the data"
connect application use case that you're describing, it is by no means
a final solution or the most ideal solution. This connect application
use case, and other related use cases, have suggested to us that we
should be exploring explicit export APIs. For instance, users of
Stripe are able to log into their dashboards and export CSV-formatted
data. The fact that this functionality is not available to connect
apps is much more of an implementation detail than it is a design
decision. It's too early to speak in terms of timelines, but I can
say that we've identified that there'd be a lot of value in providing
a hassle-free way for a connect app to receive a bulk export of data
as fast as possible, and it's something that we hope to address.
Cheers,
Jim