When retrieving large datasets from the Kariz API, results are automatically paginated to optimize performance and response times. Pagination allows you to retrieve data in manageable chunks while providing a clear way to access subsequent records.
Kariz uses token-based pagination that’s consistent across all supported e-commerce channels. When a response contains more data than can be returned in a single request, Kariz will:
Return a subset of the total results (default is 10 items per page)
Include a `next_page_token` in the response to indicate more data is available
Provide a `next_page_token_url` that can be used directly for the next request
A response that doesn’t include a `next_page_token` field indicates you’ve reached the last page of results or the entire dataset was small enough to be returned in a single response.
// Initial requestconst initialResponse = await fetch('https://api.trykariz.com/api/KarizClientApp/Unified/Products?channel=shopify&tpUserId=user123');const data = await initialResponse.json();// Process the first page of resultsprocessData(data.Output.result);// Check if there are more pagesif (data.Output.next_page_token) { // Request the next page using the token const nextPageResponse = await fetch( 'https://api.trykariz.com/api/KarizClientApp/Unified/Products?channel=shopify&tpUserId=user123&next_page_token=' + data.Output.next_page_token ); const nextPageData = await nextPageResponse.json(); // Process the next page of results processData(nextPageData.Output.result);}
You can adjust the number of results per page by using the `limit` parameter in your request:
Copy
GET https://api.trykariz.com/api/KarizClientApp/Unified/Products?channel=shopify&tpUserId=user123&limit=25
The maximum limit value is 100 items per page. Some channels may limit responses to 50 items per page, in which case, we follow their limit. If you specify a higher value, it will be capped at 100.