The Givebutter API uses pagination to break large result sets into manageable pages. This improves performance and allows you to retrieve data incrementally rather than loading thousands of records at once.
All paginated endpoints return responses in this structure:
Response Structure
First Page Example
Last Page Example
{
"data" : [
// Array of resources (campaigns, transactions, contacts, etc.)
],
"links" : {
"first" : "https://api.givebutter.com/v1/campaigns?page=1" ,
"last" : "https://api.givebutter.com/v1/campaigns?page=5" ,
"prev" : "https://api.givebutter.com/v1/campaigns?page=1" ,
"next" : "https://api.givebutter.com/v1/campaigns?page=3"
},
"meta" : {
"current_page" : 2 ,
"from" : 21 ,
"last_page" : 5 ,
"path" : "https://api.givebutter.com/v1/campaigns" ,
"per_page" : 20 ,
"to" : 40 ,
"total" : 95
}
}
Links Object
The links object provides ready-to-use URLs for navigating pages:
Field Description Value When Not Available firstURL to the first page of results Never null lastURL to the last page of results Never null prevURL to the previous page (only if current page > 1) null on first pagenextURL to the next page (only if more pages exist) null on last page
The next link is the easiest way to paginate. Keep following next until it becomes null to
fetch all results.
The meta object provides detailed pagination state:
Field Description Example current_pageThe current page number (1-indexed) 2fromThe index of the first item on this page 21toThe index of the last item on this page 40last_pageThe total number of pages 5per_pageNumber of items per page 20totalTotal number of items across all pages 95pathBase URL for the resource (without query params) https://api.givebutter.com/v1/campaigns
Query Parameters
Control pagination behavior with these query parameters:
Parameter Description Default Max pageThe page number to retrieve (1-indexed) 1- per_pageNumber of items per page 20100
Request Specific Page
Custom Page Size
Page 2 with 50 Items
curl "https://api.givebutter.com/v1/campaigns?page=3" \
-H "Authorization: Bearer YOUR_API_KEY"
The maximum per_page value is 100 . Requesting more than 100 items per page will return an
error.