elements

Counts of $autocapture, $rageclick, and $dead_click events grouped by the element chain they occurred on, ordered by count. Defaults to all three event types; narrow with the include parameter.

get/api/projects/{project_id}/elements/stats/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/elements/stats/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

data_attributesstring

Comma-separated data attribute names (wildcards allowed, e.g. data-). When provided, each element's attributes map is filtered to matching attr__ keys, shrinking the response.

date_fromstring

Start of the date range (e.g. -7d, 2024-01-01). Defaults to last 7 days.

date_tostring

End of the date range (e.g. 2024-01-31). Defaults to now.

filter_test_accountsboolean

When true, applies the project's internal-and-test-account filters to the underlying events. Pass the lowercase string true; other truthy spellings are ignored.

includestring[]

Event types to include: $autocapture, $rageclick, $dead_click. Defaults to all three. Accepts repeated parameters, a JSON array, or a comma-separated list.

limitinteger

Maximum rows per page

offsetinteger

Pagination offset

propertiesstring

JSON-encoded list of property filters to apply to the underlying events, e.g. [{"key": "$current_url", "value": "https://example.com/page"}] or [{"key": "email", "value": "@posthog.com", "operator": "icontains", "type": "person"}]. Supports event, person, cohort, element, and HogQL property filter types.

sampling_factornumber double

Sampling factor between 0 and 1

Response

nextstring nullable required

URL for the next page of results, if any

previousstring nullable required

URL for the previous page of results, if any

Changes

No recorded changes to this operation across all 1 revision of this API.