Pagination

When searching for events using the /marketplace/v1/events/search endpoint, results are paginated to help you efficiently navigate large datasets.

Query Parameters

You can control pagination using the following query parameters:

  • pageSize (number): The maximum number of results to return per page. Default is 20.
  • searchAfter (string): A cursor token to fetch the next page of results.
  • searchBefore (string): A cursor token to fetch the previous page of results.
  • skip (number): The number of results to skip (optional, for advanced use).

Example Request

curl "https://api.letsdothis.com/marketplace/v1/events/search?query=triathlon&pageSize=2" \
  -H "Authorization: Bearer {your_api_key}"

Response Structure

The response includes a page object with pagination information:

{
  "page": {
    "totalResults": 42,
    "first": "COGdCBUKccJAIg5aDGdJiDygE94pbSc6qQ==",
    "last": "CIqRBhV04LVAIg5aDGcWQp/etbjw6MHqxw=="
  }
}
  • totalResults: The total number of results available for the query.
  • first: The token for the first result in the current page of results.
  • last: The token for the last result in the current page of results.

How to Paginate

  1. Make your initial request with your desired pageSize and any search filters.
  2. To fetch the next page, use the last cursor from the response as the searchAfter parameter in your next request.
  3. To fetch the previous page, use the first cursor as the searchBefore parameter.
  4. Continue paginating using these cursors as needed.

Was this page helpful?