KosmoKrator

analytics

Fathom Analytics CLI for AI Agents

Use the Fathom Analytics CLI from KosmoKrator to call Fathom Analytics tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

6 functions 6 read 0 write Bearer token auth

Fathom Analytics CLI Setup

Fathom Analytics can be configured headlessly with `kosmokrator integrations:configure fathom`.

# 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 fathom --set access_token="$FATHOM_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor fathom --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token FATHOM_ACCESS_TOKEN Secret secret yes Access Token
url FATHOM_URL URL url no API Base URL

Call Fathom Analytics Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call fathom.fathom_list_sites '{
  "limit": 1,
  "starting_after": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:fathom fathom_list_sites '{
  "limit": 1,
  "starting_after": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs fathom --json
kosmo integrations:docs fathom.fathom_list_sites --json
kosmo integrations:schema fathom.fathom_list_sites --json
kosmo integrations:search "Fathom Analytics" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Fathom Analytics.

fathom.fathom_list_sites

Read read

List all websites tracked in Fathom Analytics. Returns site IDs, names, and domains you can query for analytics data.

Parameters
limit, starting_after

Generic CLI call

kosmo integrations:call fathom.fathom_list_sites '{"limit":1,"starting_after":1}' --json

Provider shortcut

kosmo integrations:fathom fathom_list_sites '{"limit":1,"starting_after":1}' --json

fathom.fathom_get_site

Read read

Get details for a specific Fathom Analytics site by ID. Returns site name, domain, tracking code, and other configuration.

Parameters
site_id

Generic CLI call

kosmo integrations:call fathom.fathom_get_site '{"site_id":"example_site_id"}' --json

Provider shortcut

kosmo integrations:fathom fathom_get_site '{"site_id":"example_site_id"}' --json

fathom.fathom_list_pageviews

Read read

List pageviews for a Fathom Analytics site with date filtering and pagination. Returns individual pageview records including URL, referrer, and device info.

Parameters
site_id, date_from, date_to, limit, starting_after

Generic CLI call

kosmo integrations:call fathom.fathom_list_pageviews '{"site_id":"example_site_id","date_from":"example_date_from","date_to":"example_date_to","limit":1,"starting_after":1}' --json

Provider shortcut

kosmo integrations:fathom fathom_list_pageviews '{"site_id":"example_site_id","date_from":"example_date_from","date_to":"example_date_to","limit":1,"starting_after":1}' --json

fathom.fathom_get_aggregate

Read read

Get aggregated analytics data from Fathom. Supports pageviews, visits, visitors, bounce rate, and more. Can group results by page, country, browser, device type, etc.

Parameters
site_id, date_from, date_to, metrics, group_by, sort_by, limit

Generic CLI call

kosmo integrations:call fathom.fathom_get_aggregate '{"site_id":"example_site_id","date_from":"example_date_from","date_to":"example_date_to","metrics":"example_metrics","group_by":"example_group_by","sort_by":"example_sort_by","limit":1}' --json

Provider shortcut

kosmo integrations:fathom fathom_get_aggregate '{"site_id":"example_site_id","date_from":"example_date_from","date_to":"example_date_to","metrics":"example_metrics","group_by":"example_group_by","sort_by":"example_sort_by","limit":1}' --json

fathom.fathom_list_events

Read read

List custom events tracked in Fathom Analytics for a site. Returns event names, event IDs, and configuration details.

Parameters
site_id, limit, starting_after

Generic CLI call

kosmo integrations:call fathom.fathom_list_events '{"site_id":"example_site_id","limit":1,"starting_after":1}' --json

Provider shortcut

kosmo integrations:fathom fathom_list_events '{"site_id":"example_site_id","limit":1,"starting_after":1}' --json

fathom.fathom_get_current_user

Read read

Get the currently authenticated Fathom user profile. Returns user name, email, and account details. Useful for verifying API connectivity.

Parameters
none

Generic CLI call

kosmo integrations:call fathom.fathom_get_current_user '{}' --json

Provider shortcut

kosmo integrations:fathom fathom_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

fathom.fathom_list_sites

List all websites tracked in Fathom Analytics. Returns site IDs, names, and domains you can query for analytics data.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_list_sites --json
ParameterTypeRequiredDescription
limit integer no Maximum number of sites to return (default: 20).
starting_after integer no Cursor for pagination — pass the ID of the last site from a previous response to get the next page.

fathom.fathom_get_site

Get details for a specific Fathom Analytics site by ID. Returns site name, domain, tracking code, and other configuration.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_get_site --json
ParameterTypeRequiredDescription
site_id string yes The Fathom site ID (e.g., "CDCLS").

fathom.fathom_list_pageviews

List pageviews for a Fathom Analytics site with date filtering and pagination. Returns individual pageview records including URL, referrer, and device info.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_list_pageviews --json
ParameterTypeRequiredDescription
site_id string yes The Fathom site ID (e.g., "CDCLS").
date_from string no Start date for filtering (ISO 8601, e.g., "2025-01-01").
date_to string no End date for filtering (ISO 8601, e.g., "2025-01-31").
limit integer no Maximum number of pageviews to return (default: 20).
starting_after integer no Cursor for pagination — pass the ID of the last pageview from a previous response.

fathom.fathom_get_aggregate

Get aggregated analytics data from Fathom. Supports pageviews, visits, visitors, bounce rate, and more. Can group results by page, country, browser, device type, etc.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_get_aggregate --json
ParameterTypeRequiredDescription
site_id string yes The Fathom site ID (e.g., "CDCLS").
date_from string yes Start date (ISO 8601, e.g., "2025-01-01").
date_to string yes End date (ISO 8601, e.g., "2025-01-31").
metrics string no Comma-separated metrics to retrieve. Available: pageviews, visits, visitors, bounce_rate, visit_duration. Default: all metrics.
group_by string no Group results by a dimension: page_hostname, page_path, referrer_hostname, referrer_path, country, browser, device_type, os, query_param.
sort_by string no Sort field and direction (e.g., "pageviews:desc", "visitors:asc").
limit integer no Maximum number of grouped results to return.

fathom.fathom_list_events

List custom events tracked in Fathom Analytics for a site. Returns event names, event IDs, and configuration details.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_list_events --json
ParameterTypeRequiredDescription
site_id string yes The Fathom site ID (e.g., "CDCLS").
limit integer no Maximum number of events to return (default: 20).
starting_after integer no Cursor for pagination — pass the ID of the last event from a previous response.

fathom.fathom_get_current_user

Get the currently authenticated Fathom user profile. Returns user name, email, and account details. Useful for verifying API connectivity.

Operation
Read read
Schema command
kosmo integrations:schema fathom.fathom_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

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.