How to request more than 20 pledges, only active patrons, and sort by lifetime_ammount_cents in APIv2?

I’m working in PHP. Exclusive to API v2 is the unability to set more than 20 pledges per request using ?page%5Bcount%5D=100 to get a maximum of 100 pledges. Not only I don’t need to make pagination for my patron list on my site as it doesn’t make any sense in my case, but it also seems like API v2 doesn’t even include pagination except some strange page%5Bcursor%5D=12345678abcdefg, all that I found in the documentation on this case.

About requesting only active patrons - while I could filter them out with some foreach loops, it would be nicer to request only the data I need to put less stress on Patreon servers as well as on mine. There’s nothing on this in the API documentation.

In my understanding, there’s currently no sorting by lifetime_ammount_cents? It would be useful to show the OG veterans on the top of the list, instead of all over the place. I could also sort that with some foreach loop, but again, It would be nice to have without having to set up dozens of foreach loops just to sort out this data the way I need.

I have to say that I’m just a few days new to Patreon API, and also not that experienced in PHP. If I have missed something, or you have any good workarounds for these issues, let me know.

Figured out from the JSON API documentation that for cursor pagination you just have to replace ?page%5Bcount%5D=100 with ?page%5Bsize%5D=100 and it will show more pledges. Not an elegant solution as I, for every patron to have an opportunity to get into the list, have to request ammount of pledges equal to every patron a creator ever had, just for more than half of inactive and declined to be sorted out with PHP. I understand than eventually I won’t be able to fit every patron ever and have to limit it at some point, but just sad that the most generous patrons could fall over the limit due to inability to sort by lifetime_ammount_cents.

1 Like

Pagination will eventually be inevitable as your patrons list gets larger. Better to implement pagination in your code today than later.