--- method: GET path: /api/stats/this-week auth: jwt area: stats --- # Get This Week's Stats Compact week-vs-previous-week comparison powering the dashboard widget. Week boundaries are the requesting user's calendar week (timezone-aware). ## Query Parameters | Parameter | Type | Required | Description | | ---------- | ------------- | -------- | --------------------------------------- | | library_id | string (UUID) | No | Scope totals to one library | ## Example Request ```http GET /api/stats/this-week Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ``` ## Example response ```json example-response { "week_minutes": 315, "week_pages": 122, "week_sessions": 21, "week_books": 3, "prev_week_minutes": 402, "prev_week_pages": 160, "prev_week_sessions": 25, "active_today": true, "current_streak": 5 } ``` ## Errors | Status | Body | When | | ------ | -------------------- | ---------------------- | | 400 | `invalid library id` | malformed library_id | | 401 | `invalid user` | no user in JWT context |