umami
Original:🇺🇸 English
Translated
1 scripts
Fetch analytics from Umami. Use when the user asks about umami, analytics, website traffic, daily stats, pageviews, visitors, how is my site doing, traffic report, site performance, bounce rate, visitor count, active users, who is on my site, or website statistics.
2installs
Sourcemartinhjartmyr/skills
Added on
NPX Install
npx skill4agent add martinhjartmyr/skills umamiTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Umami Analytics
Fetch traffic summaries and analytics data from an Umami instance.
Configuration
Set these environment variables before running:
| Variable | Required | Description |
|---|---|---|
| Yes | Base URL of your Umami instance (e.g. |
| One of these | API key for Umami Cloud. Used as Bearer token directly. |
| One of these | Username for self-hosted login via |
| With username | Password for self-hosted login. |
If is set, it takes precedence over username/password.
UMAMI_API_KEYWorkflow: Daily Traffic Summary
- Run the script:
bash
bash ~/Projects/skills/umami/scripts/umami-summary.sh - Parse the JSON output.
- Format as a markdown table:
| Website | Domain | Pageviews | Visitors | Visits | Bounces | Avg Time | Active |
|---|---|---|---|---|---|---|---|
| My Blog | blog.example.com | 1,234 (980) | 567 (510) | 890 (801) | 123 (110) | 45s (38s) | 3 |
| Totals | 1,234 (980) | 567 (510) | 890 (801) | 123 (110) | 45s (38s) | 3 |
- Show previous period values in parentheses after each metric (e.g. "1,234 (980)" means 1,234 current, 980 previous).
- Format numbers with commas for readability.
- Convert to human-readable duration (e.g. "1m 23s").
totaltime - Calculate average time as for each site, using
totaltime / visitsfor the previous period.prev_totaltime / prev_visits - Bold the totals row.
Workflow: Active Users Only
For "who is on my site right now?" queries, use the lightweight flag:
bash
bash ~/Projects/skills/umami/scripts/umami-summary.sh --active-onlyThis skips the stats API calls and only fetches current active visitor counts. Format as a simpler table:
| Website | Domain | Active |
|---|---|---|
| My Blog | blog.example.com | 3 |
Error Handling
The script exits non-zero and writes JSON to stderr on failure:
- Missing env vars:
{"error": "UMAMI_API_URL is not set"} - Auth failure:
{"error": "Authentication failed (HTTP 401)"} - Unreachable server:
{"error": "Could not connect to https://..."}
Report these errors clearly to the user with the specific message. Suggest checking their environment variables.
API Reference
For queries beyond the daily summary (time series, metrics breakdowns, custom date ranges), see references/api.md.