Activities API Endpoint

GET /api/v1/activities

Retrieves a paginated list of activities with their associated sessions, filtered by date range and optional custom filters.


Query Parameters

Parameter Type Required Default Description
cursor number No 0 Pagination offset - the number of records to skip
from string  (ISO 8601) No Current date Start date for filtering activities (inclusive)
to string  (ISO 8601) No 1 year from now End date for filtering activities (inclusive)
limit number No 10 Maximum number of activities to return per request
filters string  (JSON) No {} JSON-encoded object containing additional filter criteria

Response Format

Success Response (200 OK)

{
  "data": [
    {
      "title": "Activity Title",
      "subTitle": "Activity subtitle or description",
      "venue": "Venue Name",
      "coverImage": "/path/to/image.jpg",
      "sessions": [
        {
          "date": "2025-11-15T10:00:00.000Z",
          "placeLimit": 20,
          "enabled": true
        }
      ],
      "url": "https://site.pembee.app/activity/507f1f77bcf86cd799439011"
    }
  ],
  "nextPageOffset": 10
}

Response Fields

  • data : Array of activity objects
  • title : The formatted title of the activity
  • subTitle : Subtitle or additional description text
  • venue : Name of the venue where activities take place
  • coverImage : Path to the cover image (may be undefined  if no image exists)
  • sessions : Array of session objects
    • date : ISO 8601 timestamp of the session
    • placeLimit : Maximum number of participants allowed
    • enabled : Whether the session is currently enabled/visible
  • url : Direct URL to the activity details page
  • nextPageOffset : The cursor value for the next page (undefined if no more results)

Filtering Behavior

  • Date Range: Activities are filtered to include only those with sessions between from  (start of day) and to  (end of day) in the site's timezone
  • Disabled Activities: Only enabled activities are returned (includeDisabled: false )
  • Custom Filters: Additional filtering can be applied via the filters  parameter

Examples


Basic Request

Fetch the first 10 activities starting from today:

GET /api/v1/activities

Paginated Request

Fetch the next page of results:

GET /api/v1/activities?cursor=10&limit=10

Date Range Request

Fetch activities between specific dates:  

GET /api/v1/activities?from=2025-11-01&to=2025-11-30

Request with Filters

Fetch activities with custom filters:

GET /api/v1/activities?filters={"61a3419e7ecfb10009851435":"66e83af80918e3f11d90e793","61fa4ef33ee9de0009a6edb3":"61fa509ddf750900099b3de6"}

Complete Example with All Parameters

GET /api/v1/activities?cursor=20&limit=15&from=2025-11-01&to=2025-12-31&filters={"61a3419e7ecfb10009851435":"66e83af80918e3f11d90e793","61fa4ef33ee9de0009a6edb3":"61fa509ddf750900099b3de6"}

Pagination

This endpoint uses cursor-based pagination:

  1. Make an initial request without a cursor  parameter
  2. If nextPageOffset  is present in the response, use it as the cursor  value for the next request
  3. Continue until nextPageOffset  is undefined  (no more results)

Example Pagination Flow

async function fetchAllActivities() {
  while (true) {
    const response = await fetch(
      `/api/v1/activities?cursor=${cursor}&limit=20`
    );
    const { data, nextPageOffset } = await response.json();

    allActivities = [...allActivities, ...data];

    if (nextPageOffset === undefined) {
      break; // No more results
    }

    cursor = nextPageOffset;
  }

  return allActivities;
}

Notes

  • All dates are processed in the site's configured timezone
  • The endpoint respects the site's timeZone  setting for date range calculations
  • Cover images are returned as paths; prepend the appropriate base URL if needed

Changelog

  • Initial version: Supports pagination, date range filtering, and custom filters

Still need help? Contact Us Contact Us