---
updatedAt: 2026-07-09T23:15:17.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Top Pages

The pages where a given event fired most often.

Ranks the pages (`page.path`) on which an event fired most often over the window.

* Defaults to **Page Viewed** (your most-visited pages). Pass `by_event` to rank the pages tied to another event, e.g. `Subscription Created`.
* Each row's `percentage` is its share of the event's `total`.
* Pass `user_id` to scope to a single customer belonging to the site.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "core-api",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/core"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      },
      "sec1": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/analytics/customers/activity/top-pages": {
      "get": {
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "The dimension value for this bucket. Empty referrers are reported as `(direct)`."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Number of matching events in this bucket."
                          },
                          "percentage": {
                            "type": "number",
                            "description": "This bucket's share of the total matched events, as a percentage."
                          }
                        }
                      },
                      "description": "Top pages, highest count first."
                    },
                    "event": {
                      "type": "string",
                      "description": "The event whose pages were ranked."
                    },
                    "total": {
                      "type": "integer",
                      "description": "Total matching events in the window."
                    },
                    "user_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The customer the result was scoped to, or null for site-wide."
                    },
                    "days": {
                      "type": "integer",
                      "description": "Size of the resolved window, in days."
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "data": [
                        {
                          "label": "/pricing",
                          "count": 3421,
                          "percentage": 44.1
                        },
                        {
                          "label": "/",
                          "count": 1902,
                          "percentage": 24.5
                        }
                      ],
                      "event": "Page Viewed",
                      "total": 7752,
                      "user_id": null,
                      "days": 30
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request — a parameter failed validation (unknown event name or dimension, malformed date, out-of-range limit, etc.).",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": {
                        "status": 400,
                        "message": "Invalid request, please try again."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": "Unauthenticated."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The site ID to scope this request to."
          },
          {
            "name": "by_event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The customer-activity event whose pages to rank. Defaults to \"Page Viewed\". Common values: \"Page Viewed\", \"Subscription Created\", \"Registered\", \"Paywall Displayed\". The valid set is per-site; an unrecognized value returns a 400 listing the events this site has recorded."
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Scope the result to a single customer belonging to the site. Returns 404 if the customer is not on this site."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start of the window in YYYY-MM-DD. Use with `to`. When omitted, a trailing default window is used. The from–to span is capped at the site’s activity retention window (90 days by default)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End of the window in YYYY-MM-DD. Must be on or after `from` and no later than today."
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            },
            "description": "Alternative to `from`/`to`: size of the trailing window in days (1–90). Bounded by the site’s activity retention window."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Maximum number of pages to return (1–100, default 10)."
          }
        ],
        "summary": "Top Pages",
        "operationId": "get_analytics-customers-activity-top-pages",
        "description": "The pages where a given event fired most often."
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [Count Events](https://docs.pelcro.com/reference/api-core-analytics-customers-activity-count-events.md)
* [Top Referrers](https://docs.pelcro.com/reference/api-core-analytics-customers-activity-top-referrers.md)
* [Conversion Rate by Dimension](https://docs.pelcro.com/reference/api-core-analytics-customers-activity-conversion-rate-by-dimension.md)
* [Customer Journey](https://docs.pelcro.com/reference/api-core-analytics-customers-activity-journey.md)