Pagination

Serply API uses cursor-based pagination for efficient result retrieval.

Example Using Cursors

When making a request, you can specify pagination parameters:

curl --header 'X-Api-Key: YOUR_API_KEY' \
  "https://api.serply.io/v1/search?q=query&page=1&per_page=10"

The response will include pagination metadata:

{
  "results": [...],
  "pagination": {
    "page": 1,
    "per_page": 10,
    "total": 100,
    "total_pages": 10,
    "next_cursor": "abc123",
    "prev_cursor": null
  }
}

Using Cursors

To fetch the next page, use the next_cursor value:

curl --header 'X-Api-Key: YOUR_API_KEY' \
  "https://api.serply.io/v1/search?q=query&cursor=abc123" | jq

Best Practices

  • Use appropriate per_page values (default is 10, max is 100)
  • Store cursors if you need to resume pagination
  • Handle cases where next_cursor is null (last page)