---
title: "Stats Module Usage"
method: GET
path: "/api/admin/stats/module-usage"
tags: ["admin"]
---

# Stats Module Usage

`GET /api/admin/stats/module-usage`

## Request

- Base URL: `https://fojin.app` (the document declares no server; this is the origin it was published from)
- URL: `https://fojin.app/api/admin/stats/module-usage`
- Auth: HTTP bearer

Return Umami-sourced module usage stats (search / read / chat / source_click).

This endpoint reads the self-hosted Umami analytics database.  It is fully
resilient: if Umami is down or unreachable, it returns an empty result
(events=[], top_search_keywords=[]) rather than propagating a 500 error.

## Query parameters

- `days` integer

## Response `200`

Successful Response

- AdminModuleUsage
  - `days` integer, required
  - `events` ModuleEventItem[], required
    - `event_name` string, required
    - `label` string, required
    - `count` integer, required
  - `top_search_keywords` KeywordItem[], required
    - `keyword` string, required
    - `count` integer, required
  - `answer_quality` AnswerQuality, required: Behavioural answer-quality proxies, sourced from Umami events. Rates are percentages against ``chat_questions`` (questions asked); they are ``None`` when there is no chat volume in the window.
    - `chat_questions` integer, required
    - `citation_click` integer, required
    - `chat_copy` integer, required
    - `chat_retry` integer, required
    - `citation_click_rate` number, nullable
    - `copy_rate` number, nullable
    - `retry_rate` number, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform.md) · [All operations](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/revisions/969714238c61?raw)
