@kody/ fathom-analytics
Read Fathom Analytics site stats, aggregation reports, and current visitors.
- fathom
- analytics
- pageviews
- reports
- traffic
- privacy
- License
- MIT
- Published
- July 28, 2026
- Pinned commit
bd23317- Rating
- No ratings yet
- Forks
- 0
- Stars
- 0
- Adaptation effort
- —
One-click install
Install forks this package into your account and publishes it right away when it passes the standard package checks. This listing has not been reviewed by an admin.
Log in to install this package.
Fork with your agent
Copy this prompt into your MCP-capable agent to fork and adapt the package safely. Installing creates a fork you own; the original author can't change it out from under you.
Use Kody to fork the community package "@kody/fathom-analytics" (listing id: b0da2768-3702-4f51-b11e-d3bf9dfb46be). Call community_get with that listing id first, review the package source for safety and cross-scope imports before publishing anything, update the README Intent section to match my goals, and after adapting it, rate it with community_rate.
README
@kody/fathom-analytics
Intent
Give agents a simple, documented way to read Fathom Analytics data — site stats, ad-hoc aggregation reports, current visitors, and briefing-ready traffic summaries — without hand-writing authenticated fetch calls each time.
When to use
- Verify Fathom API access and list readable sites (
smokeTest,listSites) - Pull traffic numbers for a site: totals, top pages, top referrers
(
getSiteTrafficSummary) - Run flexible aggregation reports over pageviews or custom events
(
aggregate) - Check who is on a site right now (
getCurrentVisitors) - Reach any other Fathom endpoint through the guarded raw
requesthelper
Required setup
FATHOM_ANALYTICS_API_TOKENsecret (user scope) sent as theAuthorization: Bearerheader on every request. Create an API token at https://app.usefathom.com/api, then save it as a secret.- Prefill: https://heykody.dev/account/secrets/new?name=FATHOM_ANALYTICS_API_TOKEN&description=Fathom%20Analytics%20API%20token&allowedHosts=api.usefathom.com&scope=user
Exports
kody:@kody/fathom-analytics— action dispatcher plus named helpers (request,getAccount,getToken,listSites,getSite,listEvents,getEvent,aggregate,getCurrentVisitors,getSiteTrafficSummary,smokeTest)
Examples
import fathom from 'kody:@kody/fathom-analytics'
export default async function main() {
// Discover sites, then get a 7-day briefing-ready summary for one.
const access = await fathom({ action: 'smokeTest' })
return await fathom({
action: 'getSiteTrafficSummary',
siteId: 'CDBUGS',
days: 7,
})
}import { aggregate } from 'kody:@kody/fathom-analytics'
export default async function main() {
// Top blog posts by pageviews this month.
return await aggregate({
siteId: 'CDBUGS',
aggregates: 'pageviews,uniques',
fieldGrouping: 'pathname',
sortBy: 'pageviews:desc',
limit: 20,
dateFrom: '2026-07-01 00:00:00',
filters: [{ property: 'pathname', operator: 'is like', value: '/blog/*' }],
})
}Notes
- Every API request counts as one pageview against the Fathom plan. Keep
call counts low;
getSiteTrafficSummarycosts 3 requests,smokeTestcosts 2. - Rate limits are per account (free tier: 600 requests/hour, 5 concurrent).
The
requesthelper retries 429/5xx automatically honoringRetry-After. - Aggregation responses return numeric values as strings;
getSiteTrafficSummaryconverts them to numbers. - Aggregation data is only accurate from March 2021 onwards, and
date_from/date_totimestamps are interpreted in the site's reporting timezone. - The API also supports mutations (create/update/delete sites, events,
milestones). This package deliberately ships no mutation helpers — use the
raw
requesthelper for those, and only when the user explicitly asks. - List helpers default to
limit: 100(the API maximum) and surfacehasMoreplus the raw list response for cursor pagination viastartingAfter/endingBefore. - Full API reference: https://usefathom.com/api/v1
Branding
The community icon is the official Fathom Analytics mark, used with explicit permission from Fathom co-founder Jack Ellis: https://x.com/JackEllis/status/2081959336176185404 ("Yes you can! :D", 2026-07-28). Fathom Analytics is a product of Conva Ventures Inc.; this package is not affiliated with or endorsed by them.
Stars
0 stars
Log in to star this package.
Report this listing
Log in to report this listing.