Skip to main content
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.

Pagination Response Format

All paginated endpoints return responses in this structure:
{
  "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
  }
}

Pagination Metadata

The links object provides ready-to-use URLs for navigating pages:
FieldDescriptionValue When Not Available
firstURL to the first page of resultsNever null
lastURL to the last page of resultsNever null
prevURL to the previous page (only if current page > 1)null on first page
nextURL 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.

Meta Object

The meta object provides detailed pagination state:
FieldDescriptionExample
current_pageThe current page number (1-indexed)2
fromThe index of the first item on this page21
toThe index of the last item on this page40
last_pageThe total number of pages5
per_pageNumber of items per page20
totalTotal number of items across all pages95
pathBase URL for the resource (without query params)https://api.givebutter.com/v1/campaigns

Query Parameters

Control pagination behavior with these query parameters:
ParameterDescriptionDefaultMax
pageThe page number to retrieve (1-indexed)1-
per_pageNumber of items per page20100
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.