> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Mixpanel

> Product analytics from a Mixpanel project: saved Insights reports, retention, event and property counts, user profiles and cohorts, and raw event export.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/mixpanel.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=00c0015071dd38c1d6ee5550e5c985c0)

[Web Catalog · Analytics](https://docs.webrouter.net/data-apis.md?category=analytics)

Needs&#x20;

`MIXPANEL_SERVICE_ACCOUNT_USERNAME`

,&#x20;

`MIXPANEL_SERVICE_ACCOUNT_SECRET`

Endpoints

9

Auth

HTTP Basic

[Vendor docs](https://docs.mixpanel.com/reference/query-api)

&#x20;·&#x20;

[Pricing](https://mixpanel.com/pricing/)

## Setup

| Variable | | What it is |
| - | - | - |
| `MIXPANEL_SERVICE_ACCOUNT_USERNAME` | required | a Mixpanel service account's username (Organization settings > Service Accounts), granted the project to read |
| `MIXPANEL_SERVICE_ACCOUNT_SECRET` | required | that service account's secret, the Basic auth password |
| `MIXPANEL_REGION` | optional | Query API server for the project's data residency: mixpanel (US), eu.mixpanel (EU) or in.mixpanel (India). Default `mixpanel`. One of `mixpanel`, `eu.mixpanel`, `in.mixpanel`. |
| `MIXPANEL_EXPORT_SERVER` | optional | Raw export server for the same residency: data (US), data-eu (EU) or data-in (India). Default `data`. One of `data`, `data-eu`, `data-in`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Every call needs project\_id (the number in the project's settings and URL); a project with data views also needs the global view's workspace\_id.
* Rate limits are tight: the Query API allows 60 queries per hour and 5 concurrent per project; raw export allows 60 per hour, 3 per second and 100 concurrent. 429 when exceeded.
* Dates are yyyy-mm-dd and inclusive at both ends. Query results use the project's timezone; raw export reads dates as UTC for projects created from 2023.
* Several inputs are JSON encoded into one string: event lists ('\["signup","purchase"]'), distinct\_ids, values and filter\_by\_cohort. Filters (where, born\_where, on) use Mixpanel's segmentation expression syntax, e.g. properties\["\$os"]=="Linux".
* The region and export\_server settings must name the same residency as the project; a project only answers on its own servers.

## Endpoints

GET

Get a saved Insights report

The computed series of a saved Insights report, as the web app shows it.

[Open](#mixpanel-insights-saved)

GET

Query retention

First-time (birth) or recurring (compounded) retention cohorts over a date range, by day, week or month.

[Open](#mixpanel-retention-query)

GET

Count events over time

Total, unique or average counts of one or more events per minute, hour, day, week or month.

[Open](#mixpanel-events-counts)

GET

List today's top events

Today's most frequent events with counts and the change from yesterday.

[Open](#mixpanel-events-top)

GET

Break an event down by a property

Counts of one event per value of one property, over time.

[Open](#mixpanel-events-property-values)

POST

Query user or group profiles

Profiles matching a filter, a cohort or a list of distinct ids, with chosen properties.

[Open](#mixpanel-profiles-query)

POST

List saved cohorts

Every cohort in the project with its id, name, size, description and creation date.

[Open](#mixpanel-cohorts-list)

GET

Get users' event activity

The event stream of one or more users over a date range.

[Open](#mixpanel-profiles-activity)

GET

Export raw events

Raw events with every property and timestamp over a date range, optionally filtered by event name or expression.

[Open](#mixpanel-events-export)

### Get a saved Insights report

GET

`/insights`

`mixpanel.insights.saved`

The computed series of a saved Insights report, as the web app shows it.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr>
      <td>
        `bookmark_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The report's id: the number after 'report-' in the report's URL.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/insights-query) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-charts-query), [Close](https://docs.webrouter.net/data-apis/close-crm.md#close-crm-reports-activity), [Cloudflare](https://docs.webrouter.net/data-apis/cloudflare.md#cloudflare-analytics-graphql), [Google Analytics 4 (Data API)](https://docs.webrouter.net/data-apis/google-analytics.md#google-analytics-report-run), [Instagram Graph API](https://docs.webrouter.net/data-apis/instagram.md#instagram-user-insights), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-campaigns-report)

> [!NOTE]
>
> * series maps each metric to \{date: value}; headers says what the nested keys mean.

### Query retention

GET

`/retention`

`mixpanel.retention.query`

First-time (birth) or recurring (compounded) retention cohorts over a date range, by day, week or month.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr><td>`from_date` required</td><td>string</td><td>query</td><td>yyyy-mm-dd, inclusive. Example `2026-10-01`</td></tr>
    <tr><td>`to_date` required</td><td>string</td><td>query</td><td>yyyy-mm-dd, inclusive. Example `2026-10-31`</td></tr>
    <tr><td>`retention_type`</td><td>string</td><td>query</td><td>birth (first-time, the default) or compounded (recurring). One of `birth`, `compounded`</td></tr>
    <tr><td>`born_event`</td><td>string</td><td>query</td><td>The event that puts a user in a cohort. Required for birth retention. Example `Signed up`</td></tr>

    <tr>
      <td>
        `event`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        The returning event; any event when omitted.
      </td>
    </tr>

    <tr>
      <td>
        `born_where`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Segmentation expression filtering the born events.
      </td>
    </tr>

    <tr>
      <td>
        `where`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Segmentation expression filtering the events.
      </td>
    </tr>

    <tr>
      <td>
        `interval`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Units per bucket (default 1; at most 90 when unit is day).
      </td>
    </tr>

    <tr>
      <td>
        `interval_count`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Number of buckets returned (default 1), plus a 0th bucket.
      </td>
    </tr>

    <tr><td>`unit`</td><td>string</td><td>query</td><td>Bucket unit; day when omitted. One of `day`, `week`, `month`</td></tr>

    <tr>
      <td>
        `unbounded_retention`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        true counts a user retained on day N if they returned on day N or any later day.
      </td>
    </tr>

    <tr>
      <td>
        `on`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Property expression to segment the returning event by.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Top segment values to return; only with on.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/retention-query) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-retention-query)

### Count events over time

GET

`/events`

`mixpanel.events.counts`

Total, unique or average counts of one or more events per minute, hour, day, week or month.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr><td>`event` required</td><td>string</td><td>query</td><td>A JSON array of event names, as one string. Example `["Signed up", "Purchased"]`</td></tr>
    <tr><td>`type` required</td><td>string</td><td>query</td><td>general (totals), unique (unique users) or average. One of `general`, `unique`, `average`</td></tr>
    <tr><td>`unit` required</td><td>string</td><td>query</td><td>Granularity. Hourly uniques are not available. One of `minute`, `hour`, `day`, `week`, `month`</td></tr>

    <tr>
      <td>
        `interval`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Number of units back from now (1 is the current unit). Give interval or from\_date and to\_date.
      </td>
    </tr>

    <tr>
      <td>
        `from_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive. The reference marks it required; interval can stand in for the date pair.
      </td>
    </tr>

    <tr>
      <td>
        `to_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive.
      </td>
    </tr>

    <tr><td>`format`</td><td>string</td><td>query</td><td>json (default) or csv. One of `json`, `csv`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/list-recent-events) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-events-segmentation), [Mux](https://docs.webrouter.net/data-apis/mux.md#mux-views-list)

### List today's top events

GET

`/events/top`

`mixpanel.events.top`

Today's most frequent events with counts and the change from yesterday.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr><td>`type` required</td><td>string</td><td>query</td><td>general (totals), unique (unique users) or average. One of `general`, `unique`, `average`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most events to return; 100 when omitted.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/query-top-events) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-events-segmentation), [Mux](https://docs.webrouter.net/data-apis/mux.md#mux-views-list)

### Break an event down by a property

GET

`/events/properties`

`mixpanel.events.property_values`

Counts of one event per value of one property, over time.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr><td>`event` required</td><td>string</td><td>query</td><td>One event name (not an array). Example `Purchased`</td></tr>
    <tr><td>`name` required</td><td>string</td><td>query</td><td>The property to break down by. Example `plan`</td></tr>

    <tr>
      <td>
        `values`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        A JSON array of the property values wanted, as one string; all values when omitted.
      </td>
    </tr>

    <tr><td>`type` required</td><td>string</td><td>query</td><td>general (totals), unique (unique users) or average. One of `general`, `unique`, `average`</td></tr>
    <tr><td>`unit` required</td><td>string</td><td>query</td><td>Granularity. One of `minute`, `hour`, `day`, `week`, `month`</td></tr>

    <tr>
      <td>
        `interval`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Number of units back from now. Give interval or from\_date and to\_date.
      </td>
    </tr>

    <tr>
      <td>
        `from_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive.
      </td>
    </tr>

    <tr>
      <td>
        `to_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive.
      </td>
    </tr>

    <tr><td>`format`</td><td>string</td><td>query</td><td>json (default) or csv. One of `json`, `csv`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most property values to return; 255 when omitted.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/query-event-properties) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-events-segmentation), [Mux](https://docs.webrouter.net/data-apis/mux.md#mux-views-list)

### Query user or group profiles

POST

`/engage`

`mixpanel.profiles.query`

Profiles matching a filter, a cohort or a list of distinct ids, with chosen properties.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr>
      <td>
        `distinct_id`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        One profile's distinct id.
      </td>
    </tr>

    <tr>
      <td>
        `distinct_ids`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        A JSON array of distinct ids, as one string.
      </td>
    </tr>

    <tr>
      <td>
        `data_group_id`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        A group key's id, to read group profiles instead of users.
      </td>
    </tr>

    <tr>
      <td>
        `where`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        Segmentation expression filtering profiles.
      </td>
    </tr>

    <tr><td>`output_properties`</td><td>string</td><td>body</td><td>A JSON array of the property names to return, as one string. Much faster than returning every property. Example `["$email", "$last_seen"]`</td></tr>
    <tr><td>`filter_by_cohort`</td><td>string</td><td>body</td><td>A JSON object \{"id": \<cohort id>}, as one string. Not with behaviors. Example `{"id": 12345}`</td></tr>

    <tr>
      <td>
        `include_all_users`
      </td>

      <td>
        boolean
      </td>

      <td>
        body
      </td>

      <td>
        With filter\_by\_cohort: true (default) includes ids without a profile, false only those with one.
      </td>
    </tr>

    <tr>
      <td>
        `behaviors`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Event selector for exporting profiles by behaviour; not with filter\_by\_cohort.
      </td>
    </tr>

    <tr>
      <td>
        `as_of_timestamp`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Unix time pinning a behaviors query; needed to page past 1,000 profiles with behaviors.
      </td>
    </tr>

    <tr>
      <td>
        `session_id`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        The session\_id from the previous page's answer; required for any page above 0.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Page number, from 0.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/engage-query) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-users-search)

> [!NOTE]
>
> * A POST that only reads profiles; the body is form encoded.
> * Pages hold up to page\_size (1,000) profiles: send the first answer's session\_id with page 1, 2, ... until a page comes back short.

### List saved cohorts

POST

`/cohorts/list`

`mixpanel.cohorts.list`

Every cohort in the project with its id, name, size, description and creation date.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/cohorts-list)

> [!NOTE]
>
> * A POST that only lists cohorts. To get a cohort's members, query profiles with filter\_by\_cohort.

### Get users' event activity

GET

`/stream/query`

`mixpanel.profiles.activity`

The event stream of one or more users over a date range.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr>
      <td>
        `workspace_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The data view's workspace id, for projects with data views.
      </td>
    </tr>

    <tr>
      <td>
        `distinct_ids`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        A JSON array of distinct ids, as one string.
      </td>
    </tr>

    <tr>
      <td>
        `from_date`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive.
      </td>
    </tr>

    <tr>
      <td>
        `to_date`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yyyy-mm-dd, inclusive.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/activity-stream-query) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-users-activity)

> [!NOTE]
>
> * Mixpanel has put this endpoint in maintenance mode.

### Export raw events

GET

`/export`

`mixpanel.events.export`

Raw events with every property and timestamp over a date range, optionally filtered by event name or expression.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `project_id`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        The project id.
      </td>
    </tr>

    <tr><td>`from_date` required</td><td>string</td><td>query</td><td>yyyy-mm-dd, inclusive (UTC for projects created from 2023, else the project timezone). Example `2026-11-01`</td></tr>
    <tr><td>`to_date` required</td><td>string</td><td>query</td><td>yyyy-mm-dd, inclusive. Example `2026-11-01`</td></tr>

    <tr>
      <td>
        `limit`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most events to return, up to 100,000.
      </td>
    </tr>

    <tr><td>`event`</td><td>string</td><td>query</td><td>A JSON array of event names, as one string. Example `["Signed up"]`</td></tr>

    <tr>
      <td>
        `where`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Segmentation expression filtering events.
      </td>
    </tr>

    <tr>
      <td>
        `time_in_ms`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        true for millisecond timestamps; seconds by default.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mixpanel.com/reference/raw-event-export)

> [!NOTE]
>
> * The answer is newline-delimited JSON, one event per line, not a JSON array. Keep the date range and limit small: a busy project's day can be gigabytes.
> * Goes to the export server (export\_server setting), not the Query API host.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.