Custom properties endpoint

GET /api/v1/sites/{site}/properties

Returns custom property value breakdowns with visitor and event counts. If no property_id is provided, returns data for the first property. Returns empty arrays if no custom properties are configured.

Additional parameters

ParameterRequiredDescription
property_idNoUUID of the custom property to analyze. Defaults to the first property.

Example request

curl -H "Authorization: Bearer your-token" "https://pageviews.ai/api/v1/sites/{site_id}/properties?from=2026-03-01&to=2026-03-07"

Response

  • properties — List of available custom properties with id, name, and key
  • selectedPropertyId — UUID of the currently selected property
  • values — Array of property values, each with name, visitors, events, and percentage

When comparison dates are provided, each value also includes visitorComparison, eventComparison, and percentageComparison direction fields.

Example response

{
  "data": {
    "properties": [
      { "id": "x1y2z3-...", "name": "Plan Name", "key": "plan_name" }
    ],
    "selectedPropertyId": "x1y2z3-...",
    "values": [
      { "name": "Pro", "visitors": 234, "events": 567, "percentage": 45.2 },
      { "name": "Free", "visitors": 189, "events": 312, "percentage": 36.5 },
      { "name": "Enterprise", "visitors": 95, "events": 201, "percentage": 18.3 }
    ]
  }
}