Long-tail page clustering
get_longtail_clustersSegments a property's pages into Head / Chunky Middle / Long Tail tiers by elbow detection on the cumulative-clicks curve (the app's Long-tail Clustering report). Returns each tier's page count, click/impression share, average CTR/position/query-diversity, the knee points, and the top pages per tier. Useful for spotting over-reliance on a few pages or a bloated long tail to prune. Reads the ClickHouse warehouse when available, else the live Search Console API. truncated: true (with truncationNote) means a cap cut the low-click tail: the warehouse clusters at most the 100,000 pages with the most clicks, the live API reads at most 100,000 query x page rows. Date range is optional: omit startDate/endDate to analyze the last 28 settled days (data lags ~2-3 days).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preset | No | Tuning preset: default | content | ecommerce | small_site | enterprise. | default |
| endDate | No | Optional. Window end as YYYY-MM-DD (e.g. 2026-05-31). You do NOT need to know today's date or the latest available date: omit this and the server uses the latest settled Search Console date (data lags ~2-3 days behind today). Never pass null or the string "null". | |
| siteUrl | Yes | ||
| startDate | No | Optional. Window start as YYYY-MM-DD (e.g. 2026-05-03). You do NOT need to know today's date. Omit BOTH startDate and endDate to analyze the last 28 settled days automatically (Search Console data lags ~2-3 days). Never pass null or the string "null". | |
| sensitivity | No | Override the preset's knee sensitivity: low | normal | high. | |
| pagesPerCluster | No | How many top pages to list per tier (default 10). 0 returns tier stats only. | |
| includeZeroClicks | No | Include pages with zero clicks (impressions only). Defaults per preset (usually true). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| knees | No | ||
| range | No | ||
| preset | No | ||
| totals | No | ||
| siteUrl | No | ||
| clusters | No | ||
| warnings | No | ||
| truncated | No | ||
| dataSource | No | ||
| sensitivity | No | ||
| truncationNote | No | ||
| apiRowCapReached | No |