Get aggregation with the Fathom Analytics API

Builds a custom report on the pageviews of a site or on one event: totals, or grouped by period and by fields such as pathname, referrer_source or utm_campaign. Numbers come back as text, and there is no pagination: grouped reports return up to 500 rows unless limit says otherwise.

Identifier
fathom_get_aggregation

The request

POST https://connect.reportei.com/api/tools/fathom_get_aggregation/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "entity": "pageview",
    "aggregates": "<aggregates>"
  }
}

Your system sends your customer's connection id and the tool arguments. The headers are the same as the rest of the Connect API: your product's token and your customer's token.

Parameters

ParameterTypeRequiredDescription
entitystringYespageview reports on the visits of a site, event on one event.Values: pageview, event
entity_idstringNoWith entity pageview, required: the id of the site, from List sites.
site_idstringNoWith entity event, required: the id of the site, from List sites.
entity_namestringNoWith entity event, required: the name of the event, from List events.
aggregatesstringYesComma-separated aggregates. For pageview: visits, uniques, pageviews, avg_duration and bounce_rate. For event: conversions, unique_conversions and value, which comes in cents.
date_groupingstringNoGroups the numbers by period. Omit it for totals. hour only works for ranges of up to 7 days.Values: hour, day, month, year
field_groupingstringNoComma-separated fields to group by: hostname, pathname, entry_page, exit_page, referrer_hostname, referrer_pathname, referrer_source, ai_source, browser, country_code, city, state, region, device_type, operating_system, utm_campaign, utm_content, utm_medium, utm_source, utm_term, keyword or ref.
sort_bystringNoA field of aggregates or field_grouping with asc or desc, for example pageviews:desc. With date_grouping, timestamp:asc and timestamp:desc also work.
date_fromstringNoStart as YYYY-MM-DD HH:MM:SS in the timezone of the site, for example 2026-10-01 00:00:00. The default is the first recorded data.
date_tostringNoEnd as YYYY-MM-DD HH:MM:SS in the timezone of the site. The default is now.
limitintegerNoMaximum rows, up to 1000. With field_grouping, the default is 500.
filtersstringNoJSON array of filters, as text. Each filter has property, operator (is, is not, is like, is not like, matching or not matching) and a text value, for example [{"property":"pathname","operator":"is","value":"/pricing"}].

Supported connections

Your customer connects their Fathom Analytics account once, with one of the modes below. The same connection serves every tool of the toolkit.

API key

Your customer pastes the app's key on a Connect screen, or your system sends the key with POST /api/customer-toolkits, with no screen.

The response

On success, Connect preserves the app's response status and body. HTTP errors returned by the app use the {error, api_error} envelope; authentication or validation can fail before execution. The X-Toolkit-Execution-Id header identifies the recorded execution, available at GET /api/tools/executions/{uuid}.

Ready for AI agents

This tool's input is a JSON Schema, available at GET /api/tools/fathom_get_aggregation. It becomes your agent's tool definition with no conversion.

See Connect applied to your product.

Try it for 15 days with no card, or walk our team through your use case.