Use the Plausible Analytics CLI from KosmoKrator to call Plausible Analytics tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Plausible Analytics can be configured headlessly with `kosmokrator integrations:configure plausible`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure plausible --set api_key="$PLAUSIBLE_API_KEY" --enable --read allow --write ask --jsonkosmokrator integrations:doctor plausible --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
PLAUSIBLE_API_KEY
Secret secret
yes
API Key
url
PLAUSIBLE_URL
URL url
no
Plausible URL
Call Plausible Analytics Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Plausible Analytics.
plausible.plausible_query_stats
Read read
Query website analytics from Plausible. Supports aggregate stats, timeseries, and breakdowns by dimension. Use dimensions to group results (e.g., by country, source, page). Omit dimensions for simple aggregate totals.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
plausible.plausible_query_stats
Query website analytics from Plausible. Supports aggregate stats, timeseries, and breakdowns by dimension. Use dimensions to group results (e.g., by country, source, page). Omit dimensions for simple aggregate totals.
Time period: "7d", "28d", "30d", "month", "3mo", "6mo", "12mo", or "custom" (requires date_from/date_to).
dimensions
array
no
Dimensions to group by: visit:source, visit:country, visit:city, visit:device, visit:browser, visit:os, event:page, event:name, time:day, time:month, etc.
filters
string
no
JSON-encoded filter expressions, e.g., [["is", "visit:country", ["NL"]]]. Pass as a JSON string.
date_from
string
no
Start date (ISO 8601, e.g., "2025-01-01") when date_range is "custom".
date_to
string
no
End date (ISO 8601, e.g., "2025-01-31") when date_range is "custom".
order_by
string
no
JSON-encoded order, e.g., [["visitors", "desc"]]. Pass as a JSON string.
limit
integer
no
Maximum number of results to return. Sent as pagination.limit (default: 10000).
plausible.plausible_realtime_visitors
Get the current number of realtime visitors on a website (visitors in the last 5 minutes).
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.