Analytics

Event segmentation

Changed on

Return metrics for one or two events over a date range, optionally segmented and grouped. URL-encode special characters in event types and property names.

get/api/2/events/segmentation

Request

  • Base URL
    https://amplitude.com
  • Auth
    HTTP basic

Query parameters

estring required

Event definition as a JSON object with event_type and optional filters and group_by. Use _active for any active event, _all for any event, and prefix custom events with ce:.

e2string

Second event definition, same shape as e.

startstring required
Example:20260801

First date included in the data series, formatted YYYYMMDD.

endstring required
Example:20260831

Last date included in the data series, formatted YYYYMMDD.

m'uniques' | 'totals' | 'pct_dau' | 'average' | 'histogram' | 'sums' | 'value_avg'

Metric to return. Non-property metrics: uniques, totals, pct_dau, average. Property metrics: histogram, sums, value_avg.

iinteger

Interval: 1 for daily, 7 for weekly, 30 for monthly. Use -300000, -3600000 for realtime intervals.

sstring

Segment definitions, as a JSON array of filter condition objects. Repeat the parameter for multiple segments.

gstring

Property to group by, for example platform. Available only with a single segment. Limit: two.

limitinteger

Number of group-by values returned. Max 1000.

Response

Series data with labels and per-series values.

object required

Changes

    • info

      added the media type */* for the response with the status

    • info

      added the media type */* for the response with the status

    • info

      added the media type */* for the response with the status