Skip to main content

Overview

List endpoints in the InstaView API support pagination to handle large datasets efficiently. Understanding pagination helps you retrieve data optimally without hitting rate limits or performance issues.

Pagination Parameters

All list endpoints accept these query parameters:
page
integer
default:"1"
Page number to retrieve (1-indexed)
limit
integer
default:"20"
Number of items per page (max: 100)

Example Request

Response Format

Paginated responses include metadata about the result set:

Pagination Metadata

total
integer
Total number of items across all pages
page
integer
Current page number
limit
integer
Items per page
totalPages
integer
Total number of pages
hasNextPage
boolean
Whether there are more pages after this one
hasPreviousPage
boolean
Whether there are pages before this one

Pagination Strategies

Sequential Pagination

Iterate through pages sequentially:

Rate-Limited Pagination

Add delays between requests to avoid rate limits:

Parallel Pagination

Fetch multiple pages concurrently (if you know the total):

Generator-Based Pagination

Use generators for memory-efficient iteration:

Filtering with Pagination

Combine filters with pagination:

Complex Filtering

Optimizing Page Size

Choose appropriate page sizes:
Use When:
  • Displaying in UI with client-side pagination
  • Network is slow or unreliable
  • Processing items individually
Pros:
  • Faster initial response
  • Less memory usage
  • Better for mobile clients
Cons:
  • More API calls required
  • Higher overhead for large datasets

Dynamic Page Sizing

Adjust page size based on response time:

Caching Paginated Results

Cache pages to reduce API calls:

Progress Tracking

Show progress for long-running pagination:

Best Practices

Troubleshooting

Returns empty items array, not an error.

Next Steps

Rate Limiting

Avoid rate limits during pagination

Best Practices

Production-ready patterns

Error Handling

Handle pagination errors

API Reference

See all paginated endpoints