Pagination
Navigate large datasets efficiently with token and offset pagination
Overview
Sayari API uses two pagination methods optimized for different endpoints:
Token Pagination
Entity endpoints with dynamic content
Offset Pagination
Search, records, and traversals
Token Pagination
Used for entity endpoints (/entity/:id
) where result size is unpredictable.
Request
Response
Parameters:
next/prev
: String tokens for navigationlimit
: Items per page (default: 100)
Offset Pagination
Used for search, records, and traversals with bounded results.
Request
Response
Parameters:
offset
: Results to skip (default: 0)limit
: Max items to return (default: 100)next
: Boolean indicating more results
Endpoint Examples
Records
Traversals
Traversal Response
Traversal responses include explored_count
showing entities examined during graph traversal, but omit size
values for performance.
Best Practices
- Token pagination: Check for
next
/prev
token presence - Offset pagination: Use
next
boolean to continue - Start with default limits, adjust based on performance needs
- Avoid deep offsets for better performance