Build or update the BlueBubbles external channel plugin for Moltbot (extension package, REST...
npx skills add jarvis-survives/goatcounter-skill
Or install specific skill: npx add-skill https://github.com/jarvis-survives/goatcounter-skill
# Description
Query GoatCounter analytics API for pageviews, visitor stats, top pages, and referrers. Use when checking website analytics, traffic stats, visitor counts, or page performance. Triggers on: GoatCounter, analytics, pageviews, visitors, traffic, stats, referrers.
# SKILL.md
name: goatcounter
description: Query GoatCounter analytics API for pageviews, visitor stats, top pages, and referrers. Use when checking website analytics, traffic stats, visitor counts, or page performance. Triggers on: GoatCounter, analytics, pageviews, visitors, traffic, stats, referrers.
GoatCounter Analytics
Query GoatCounter via REST API. Lightweight, privacy-friendly web analytics.
Prerequisites
- Create API Token: Dashboard β Settings β API tokens β New
- Set Environment Variables:
bash export GOATCOUNTER_SITE="yoursite" # Site code (from yoursite.goatcounter.com) export GOATCOUNTER_TOKEN="your-token" # API token
API Basics
- Base URL:
https://{site}.goatcounter.com/api/v0 - Auth:
Authorization: Bearer {token} - Rate Limit: 4 requests/second
Quick Commands
Check Auth
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/me" | jq
Total Stats (pageviews + visitors)
# Last 7 days
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/stats/total" | jq
# Custom date range
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/stats/total?start=2024-01-01&end=2024-01-31" | jq
Today's Stats
TODAY=$(date +%Y-%m-%d)
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/stats/total?start=$TODAY&end=$TODAY" | jq
Top Pages (hits per path)
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/stats/hits?limit=10" | jq
All Paths
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/paths" | jq
Referrer Stats for a Path
# Get path_id from /paths first, then:
curl -sH "Authorization: Bearer $GOATCOUNTER_TOKEN" \
"https://$GOATCOUNTER_SITE.goatcounter.com/api/v0/stats/hits/{path_id}" | jq
Helper Script
Use scripts/goatcounter.sh for common queries:
./goatcounter.sh stats # Total stats (7 days)
./goatcounter.sh today # Today's visitors
./goatcounter.sh pages [n] # Top n pages (default 10)
./goatcounter.sh paths # List all paths
./goatcounter.sh me # Auth check
Response Examples
/stats/total
{
"total": 1234,
"total_unique": 567
}
/stats/hits
{
"hits": [
{
"path": "/",
"title": "Home",
"count": 500,
"count_unique": 200
}
]
}
/paths
{
"paths": [
{
"id": 1,
"path": "/",
"title": "Home",
"event": false
}
]
}
Common Workflows
Daily Traffic Summary
1. Query /stats/total with today's date
2. Query /stats/hits?limit=5 for top pages
3. Report: total visitors, top pages
Weekly Report
1. Query /stats/total for last 7 days
2. Query /stats/hits for page breakdown
3. Compare to previous week if needed
Debug Low Traffic
1. Check /paths to see what's being tracked
2. Query /stats/hits for specific pages
3. Check referrer stats for traffic sources
# README.md
GoatCounter Skill for OpenClaw
OpenClaw skill for querying GoatCounter analytics via their REST API.
Features
- Query total pageviews and visitor counts
- Get top pages by traffic
- View referrer stats
- Track all monitored paths
- Helper script for common operations
Setup
- Create an API token in GoatCounter: Dashboard β Settings β API tokens
- Set environment variables:
bash export GOATCOUNTER_SITE="yoursite" # from yoursite.goatcounter.com export GOATCOUNTER_TOKEN="your-token"
Usage
Via OpenClaw
Just ask your agent about your analytics:
- "How many visitors did I get today?"
- "What are my top pages this week?"
- "Show me my GoatCounter stats"
Via Helper Script
./scripts/goatcounter.sh stats # Total stats (7 days)
./scripts/goatcounter.sh today # Today's visitors
./scripts/goatcounter.sh pages 5 # Top 5 pages
./scripts/goatcounter.sh paths # All tracked paths
Installation
Copy to your OpenClaw skills directory or symlink:
ln -s /path/to/goatcounter-skill ~/.openclaw/skills/goatcounter
License
MIT
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.