How many request can I make per second before I get 429?

I want to use this API:

/api/oauth2/v2/campaigns/${ID}/members?${params}

To get a data of all members but the endpoint returns only 20 results so I’ll need to use cursor and a lot of requests to get the whole list.

My question is, can I run this in a loop - request by request or do I need to add some “sleep” time between the requests to avoid 429 error?

Since I have my app already deployed, I don’t want to run experiments that would get me banned for unknown time…

You can request a larger page set. Ie, a 100 result per page set. Just check the pagination section in the docs.

1 Like

I can’t see it there:
https://docs.patreon.com/#get-api-oauth2-v2-campaigns-campaign_id-members

Returns from this endpoint have 1000 results in one page. If pledge events are requested in includes, it has 500 results in one page. Do make sure to paginate your results by using next pagination cursor and cycle until there is no next page cursor in the API return.

(I wish I get 1000 or 500, but I’m getting 20)

Also the example doesn’t show any page-size-like parameter:
// Sample response for (url decoded) https://www.patreon.com/api/oauth2/v2/campaigns/{campaign_id}/members?include=currently_entitled_tiers,address&fields[member]=full_name,is_follower,last_charge_date,last_charge_status,lifetime_support_cents,currently_entitled_amount_cents,patron_status&fields[tier]=amount_cents,created_at,description,discord_role_ids,edited_at,patron_count,published,published_at,requires_shipping,title,url&fields[address]=addressee,city,line_1,line_2,phone_number,postal_code,state

This is what I call:

const url = `https://www.patreon.com/api/oauth2/v2/campaigns/${campaignId}/members?include=currently_entitled_tiers,user&fields%5Bmember%5D=patron_status,last_charge_date,lifetime_support_cents,currently_entitled_amount_cents,email&page%5Bcursor%5D=${next}`;

EDIT:
Found it:
https://docs.patreon.com/?javascript#pagination-and-sorting
(it’s a page%5Bcount%5D=2000 parameter)

Check out how the api does pagination:

https://docs.patreon.com/#pagination-and-sorting