Fathom Analytics Reports API
Aggregation reports and current visitor counts
Aggregation reports and current visitor counts
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/fathom-reports-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Fathom Analytics REST Account Reports API
description: 'Privacy-first, GDPR-compliant, cookie-free website analytics API. Manage sites, events, and milestones; generate aggregated custom reports; and retrieve real-time visitor counts. Authentication uses Bearer token API keys generated in the account settings area.
'
version: '1'
contact:
name: Fathom Analytics Support
email: support@usefathom.com
termsOfService: https://usefathom.com/terms
license:
name: Proprietary
servers:
- url: https://api.usefathom.com/v1
description: Fathom Analytics API v1
security:
- BearerAuth: []
tags:
- name: Reports
description: Aggregation reports and current visitor counts
paths:
/aggregations:
get:
operationId: getAggregations
summary: Get aggregations
description: 'Returns aggregated analytics data. Rate limited to 10 requests per minute. Supports grouping by time period and dimension fields, sorting, filtering, and timezone-aware date ranges.
'
tags:
- Reports
parameters:
- name: entity
in: query
required: true
description: The entity type to aggregate.
schema:
type: string
enum:
- pageview
- event
- name: entity_id
in: query
required: false
description: Required when entity is "pageview". The site ID.
schema:
type: string
- name: site_id
in: query
required: false
description: Required when entity is "event". The site ID.
schema:
type: string
- name: entity_name
in: query
required: false
description: Required when entity is "event". The event name.
schema:
type: string
- name: aggregates
in: query
required: true
description: 'Comma-separated list of aggregate metrics. For pageviews: visits, uniques, pageviews, avg_duration, bounce_rate. For events: conversions, unique_conversions, value.
'
schema:
type: string
- name: date_grouping
in: query
required: false
description: Group results by time period.
schema:
type: string
enum:
- hour
- day
- month
- year
- name: field_grouping
in: query
required: false
description: 'Dimension field to group by. Allowed values: hostname, pathname, referrer_hostname, browser, country_code, city, device_type, operating_system, utm_source, utm_medium, utm_campaign, utm_content, utm_term, keyword.
'
schema:
type: string
- name: sort_by
in: query
required: false
description: Sort order in field:asc or field:desc format.
schema:
type: string
- name: timezone
in: query
required: false
description: IANA TZ database timezone name (e.g. America/New_York).
schema:
type: string
- name: date_from
in: query
required: false
description: Start of date range as Unix timestamp.
schema:
type: integer
- name: date_to
in: query
required: false
description: End of date range as Unix timestamp.
schema:
type: integer
- name: limit
in: query
required: false
description: Maximum number of results to return.
schema:
type: integer
- name: filters
in: query
required: false
description: 'JSON-encoded array of filter objects with field, operator (is, is not, is like, matching, not matching), and value keys.
'
schema:
type: string
responses:
'200':
description: Aggregated analytics results
content:
application/json:
schema:
$ref: '#/components/schemas/AggregationResult'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/current_visitors:
get:
operationId: getCurrentVisitors
summary: Get current visitors
description: 'Returns the number of visitors currently on a site. Rate limited to 10 requests per minute.
'
tags:
- Reports
parameters:
- name: site_id
in: query
required: true
description: The site ID to query.
schema:
type: string
- name: detailed
in: query
required: false
description: If true, returns breakdown by page and referrer.
schema:
type: boolean
responses:
'200':
description: Current visitor count and optional detail
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentVisitors'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
components:
schemas:
Error:
type: object
properties:
error:
type: string
description: Human-readable error message.
required:
- error
AggregationResult:
type: object
properties:
data:
type: array
items:
type: object
additionalProperties:
type: string
description: Dynamic keys matching the requested aggregates and groupings.
CurrentVisitors:
type: object
properties:
total:
type: integer
description: Total number of current visitors on the site.
content:
type: array
description: Per-page breakdown (when detailed=true).
items:
type: object
properties:
pathname:
type: string
total:
type: integer
referrers:
type: array
description: Per-referrer breakdown (when detailed=true).
items:
type: object
properties:
referrer:
type: string
total:
type: integer
responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: API key generated in account settings at https://app.usefathom.com/api