DeviceUsageResponse / PopularBooksResponse / services.JobResult pinned by type; jobs create uses an inline anonymous request struct (RawMessage pin). Two UNVERIFIED markers recorded (analytics date-range params, facet value element shape).
40 lines
773 B
Markdown
40 lines
773 B
Markdown
---
|
|
method: GET
|
|
path: /api/analytics/popular-books
|
|
auth: jwt
|
|
area: analytics
|
|
---
|
|
<!-- source: internal/handlers/analytics.go PopularBooksResponse / GetPopularBooks -->
|
|
|
|
# Get Popular Books
|
|
|
|
Most-read books for the signed-in user.
|
|
|
|
## Example response
|
|
|
|
```json example-response
|
|
{
|
|
"books": [
|
|
{
|
|
"media_item_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"title": "1984",
|
|
"author": "George Orwell",
|
|
"read_count": 3,
|
|
"avg_completion": 0.95,
|
|
"last_read": "2026-10-24T13:57:01Z"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Query parameters
|
|
|
|
UNVERIFIED: accepts the standard analytics date-range params; confirm exact
|
|
names before relying on them.
|
|
|
|
## Errors
|
|
|
|
| Status | Body | When |
|
|
| ------ | ---- | ---- |
|
|
| 500 | `{"error": "..."}` | unexpected server error |
|