
To help you collect API responses more efficiently, save bandwidth, reduce memory consumption, and improve performance, you can use API pagination—a method of retrieving response data in manageable chunks.
And while there’s a variety of different types of API pagination to choose from, one of the options at the top of your list is likely keyset pagination (i.e., "seek pagination").
We’ll help you determine whether you should use keyset pagination by breaking down how it works, highlighting examples of it, sharing its pros and cons, and more.
It’s a pagination method that uses a key (e.g., ID) to help the client and the server request and provide progressive sets of data.
More specifically, the client uses the key within the request to indicate the starting point for the next set of results; while the API response includes what the next key should be.

To help clarify our definition, let’s differentiate keyset pagination from other pagination methods.
{{this-blog-only-cta}}
While both methods use a starting point to fetch records and define how much data to fetch from a given request, keyset pagination doesn’t skip records, while offset pagination can.
The two methods are very similar to one another. The main difference between them is how they handle position tracking and the continuation of data retrieval.
Related: What is cursor-based pagination?
To help bring our definition to life, let’s break down a few examples of keyset pagination.
Say an application tracks a certain type of data, like a product, by its IDs.
To help you fetch the next set of products in that application's server, you can include the ID in the API request as follows: <code class="blog_inline-code">GET /api/products?last_id=1023&limit=10</code?
Imagine the data you want to retrieve uses timestamps that are structured in a certain format.
You can then use a key that denotes the last timestamp you fetched in your API request using that format. Here’s how it can look: <code class="blog_inline-code">GET /api/events?last_timestamp=2023-07-14T12:00:00Z&limit=10</code>
In some cases, you might need to rely on both IDs and timestamps to gather data in the correct order.
When that’s the case, you can use both the last ID and the last timestamp fetched, leading your request to look something like the following: <code class="blog_inline-code">GET /api/messages?last_id=5678&last_timestamp=2023-07-14T11:59:59Z&limit=10</code>
Related: Best practices for performing API pagination
To help you decide whether to perform keyset pagination, you’ll need to consider the approach’s pros and cons.
While implementing keyset pagination for one API provider might not be time and resource intensive, you’re likely looking to integrate with several other API providers. And since each provider has unique pagination requirements, your engineers will likely quickly find themselves consumed with meeting them.
To help you avoid this challenge, you can use Merge, the leading unified API solution.

Merge lets you only worry about their unified API’s approach to pagination, rate limits, and authentication, while letting you access hundreds of integrations across software categories, such as HRIS, file storage, ATS, and accounting.
You can learn more about Merge by scheduling a demo with one of our integration experts.
Simply build to Merge's Unified API to add hundreds of API-based integrations to your product.