---
title: "Api Analytics View Trend"
method: GET
path: "/api/analytics/view-trend"
tags: ["Admin"]
---

# Api Analytics View Trend

`GET /api/analytics/view-trend`

## Request

- Base URL: `https://www.oxfordledge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://www.oxfordledge.com/api/analytics/view-trend`
- Auth: none declared

#64 R6 — long-window per-view trend from analytics_hourly (the only
durable analytics store; privacy-safe long window, no user_id). Honest
only from the d0915dbe rollup fix (2026-08-13) — the response's
`data_starts` says where history actually begins.

## Query parameters

- `weeks` integer

## Response `200`

Successful Response

- AdminViewTrendResponse: `GET /api/analytics/view-trend` — #64 R6, the long-window per-view trend from analytics_hourly (the only store surviving the 30-day analytics_events retention; privacy-safe long window — no user_id). `data_starts` is load-bearing honesty: the rollup kept ~4-8% of traffic biased toward one hour of day until d0915dbe (2026-08-13), so the series is only trustworthy from that date and the FE renders the short series AS short rather than extrapolating. `series` maps view -> {ISO week 'IYYY-Www' -> page_view count}.
  - `weeks` integer, required
  - `data_starts` string, nullable
  - `views` string[], required
  - `series` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
