Skip to main content
The Byteful API uses pagination to manage large result sets efficiently. Without pagination, endpoints that return many items could slow down your application and consume unnecessary data.

How Pagination Works

When you make a request to an endpoint that returns multiple items (like search endpoints), the API divides the results into pages and returns one page at a time. This approach:
  • Improves performance for large datasets
  • Reduces data consumption
  • Provides more predictable response times
  • Makes responses easier to process
Some /search endpoints may return total_count as -1 in cases where the number of objects is too large to count efficiently and quickly.

Pagination Parameters

Byteful API uses the following query parameters to control pagination:

Example Request

This request would retrieve the second page of proxies, with 25 proxies per page.

Pagination Response

Paginated responses include metadata to help you navigate through all available results. Here’s what you’ll find in a typical paginated response:

Pagination Response Fields

Calculating Total Pages

To calculate the total number of pages, use:

Pagination Limits

  • Minimum per_page: 1
  • Maximum per_page: 100
  • Default per_page: 100
  • Minimum page: 1
If you request a page beyond the available data, you’ll receive an empty data array

Code Examples

Efficient Pagination Strategies

Sequential Paging

The simplest approach is to request page 1, then page 2, and so on. This is demonstrated in the code examples above for each language.

Parallel Paging

For faster data collection, you can calculate the total pages and make multiple concurrent requests. This approach is particularly useful when you need to retrieve a large dataset quickly. The parallel examples above show how to implement this pattern in different languages.
Use parallel paging cautiously to avoid rate limiting. Consider how many concurrent requests you’re making to the API.