How Pagination Works
When you perform a fresh search usingPOST /api/v1/search, the response will include a cursor field if more results are available.
Retrieving the Next Page
To fetch the next set of results, you must send anotherPOST /api/v1/search request, but this time, you must include the cursor field. All other search parameters (Origin, Dest, etc.) should be omitted or kept the same; the cursor takes precedence.
Cursor Details
- Type: Base64 encoded string.
- Expiration: Cursors are tied to the original
search_idand are valid for 30 minutes. After this time, the cached results are cleared, and you must perform a new search. - Limit: You can specify a different
limitfor each page request (default is 100).
Implementation Checklist
- First Search: Call
/searchand store thesearch_id. - Infinite Scroll/Load More: Check if
cursoris present in the response. - Subsequent Fetch: Send the
cursorto get the next page. - End of Results: If the
cursorisnullor missing, all results have been retrieved.