Skip to main content
Use this endpoint to get a ranked breakdown of any single dimension tracked by Betterumami. Pass the type parameter to select the dimension you want — for example path for top pages, country for visitor geography, or utmSource for campaign sources. The response is an array of {x, y} objects sorted from highest to lowest count, making it straightforward to render leaderboard tables or bar charts. GET /api/websites/{websiteId}/metrics

Request

Headers

string
required
Bearer token. Pass your API key: Authorization: Bearer <api-key>

Path Parameters

string
required
The unique UUID of the website to query.

Query Parameters

Required

string
required
The dimension to rank. Accepted values: path, entry, exit, title, query, hostname, referrer, domain, channel, event, tag, browser, os, device, screen, language, country, region, city, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm.

Date Range

number
Start of the date range as a Unix timestamp in milliseconds.
number
End of the date range as a Unix timestamp in milliseconds.
string
Start of the date range as an ISO 8601 date or datetime.
string
End of the date range as an ISO 8601 date or datetime.
string
IANA time zone for date interpretation, e.g. Asia/Tokyo.
string
Comparison period: prev or yoy.
number
Maximum number of rows to return. Defaults to server-defined limit.
number
Number of rows to skip before returning results.
Filter dimension values by a search string.

Filters

string
Filter by URL path.
string
Filter by referring URL.
string
Filter by page title.
string
Filter by URL query string.
string
Filter by operating system.
string
Filter by browser name.
string
Filter by device category.
string
Filter by ISO 3166-1 alpha-2 country code.
string
Filter by visitor region.
string
Filter by visitor city.
string
Filter by browser language.
string
Filter by custom event name.
string
Filter by UTM source.
string
Filter by UTM medium.
string
Filter by UTM campaign name.
string
Filter by UTM content.
string
Filter by UTM term.
string
Filter by a tag.
string
Filter by hostname.
string
Filter by custom visitor identifier.
integer
Filter by event type: 1 for pageviews, 2 for custom events.
string
Set to any non-empty value to exclude single-pageview visits.
string
UUID of a saved segment to apply.
string
UUID of a saved cohort to filter by.
string
Filter combination logic: all (AND, default) or any (OR).

Response

200 – Success Returns an array of ranked rows, sorted by y (count) in descending order.
string | null
required
The dimension value, e.g. "/blog/my-post" for type=path, or "US" for type=country. null when the dimension value is unknown.
number
required
The count for this dimension value. For activity dimensions (path, event, etc.) this is pageviews or event fires. For visitor dimensions (country, browser, os, etc.) this is unique visitors.
string
An optional secondary label returned for certain dimension types.
200 Response

Code Sample