Overview
The GetBill API uses page-based pagination for endpoints that return lists of resources. You can specify the page number and items per page to navigate through large datasets.Pagination Parameters
All list endpoints support the following query parameters:integer
default:"1"
The page number to retrieve. Pages start at 1.
integer
default:"20"
The number of items to return per page. Maximum is 100.
Response Format
Paginated responses follow this structure:array
Array of resources for the current page
object
Pagination metadata
Example Usage
Basic Pagination
JavaScript Implementation
Python Implementation
Best Practices
Use Appropriate Page Sizes
Choose page sizes based on your use case. Smaller pages (20-50) for UI display, larger pages (100) for bulk processing.
Implement Error Handling
Handle network errors and API failures gracefully, especially in loops processing multiple pages.
Respect Rate Limits
Add delays between requests when processing large datasets to avoid hitting rate limits.
Use Iterators for Large Datasets
For large datasets, use iterators instead of loading all data into memory at once.
Performance Considerations
Memory Usage
When dealing with large datasets:Rate Limiting
Add delays when processing multiple pages:Filtering with Pagination
All pagination parameters can be combined with filtering parameters:Filters are applied before pagination, so the total count reflects the filtered dataset, not all records.
Error Handling
Handle pagination-specific errors:Endpoints Supporting Pagination
The following endpoints support pagination:GET /external-api/v1/debts- List debtsGET /external-api/v1/debts/creditor/{creditorId}- List debts by creditorGET /external-api/v1/debts/debtor/{debtorId}- List debts by debtorGET /external-api/v1/debtors- List debtorsGET /external-api/v1/creditors- List creditorsGET /external-api/v1/followups- List followupsGET /external-api/v1/followups/debt/{debtId}- List followups for a debtGET /external-api/v1/todos- List todos (agreements and disputes)