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

# Query Segmentation Report

> Get data for an event, segmented and filtered by properties. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.



## OpenAPI

````yaml openapi/query.openapi.yaml GET /segmentation
openapi: 3.0.3
info:
  title: Query API
  description: query api
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    url: https://mixpanel.com/get-support
  version: 1.0.0
servers:
  - url: https://{regionAndDomain}.com/api/query
    description: Mixpanel's calculated data API
    variables:
      regionAndDomain:
        default: mixpanel
        enum:
          - mixpanel
          - eu.mixpanel
          - in.mixpanel
        description: |
          The server location to be used:
            * `mixpanel` - The default (US) servers used for most projects
            * `eu.mixpanel` - EU servers if you are enrolled in EU Data Residency
            * `in.mixpanel` - India servers if you are enrolled in India Data Residency
security:
  - ServiceAccount: []
  - ProjectSecret: []
tags:
  - name: Activity Feed
    description: See a profiles recent events history
  - name: Cohorts
    description: Understand what defines a cohort and how many profiles qualify
  - name: Engage
    description: Query for profile information
  - name: Event Breakdown
    description: Breakdowns on the most common events in your project
  - name: Funnels
    description: Query data shown in your Funnels reports
  - name: Insights
    description: Query data shown in your Insights reports
  - name: JQL
    description: Write a custom query on your data
  - name: Retention
    description: Query data shown in your Retention reports
  - name: Segmentation
    description: Query data shown in your Segmenation reports
paths:
  /segmentation:
    get:
      tags:
        - Segmentation
      summary: Query Segmentation Report
      description: >-
        Get data for an event, segmented and filtered by properties. The Query
        API has a rate limit of 60 queries per hour and a maximum of 5
        concurrent queries.
      operationId: segmentation-query
      parameters:
        - in: query
          name: project_id
          schema:
            type: integer
          description: Required if using service account to authenticate request.
          required: true
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/eventName'
        - in: query
          name: from_date
          schema:
            type: string
          description: >-
            The date in yyyy-mm-dd format to begin querying from. This date is
            inclusive.
          required: true
        - in: query
          name: to_date
          schema:
            type: string
          description: The date in yyyy-mm-dd format to query to. This date is inclusive.
          required: true
        - $ref: '#/components/parameters/on'
        - in: query
          name: unit
          schema:
            type: string
            enum:
              - minute
              - hour
              - day
              - month
          description: >-
            This can be "minute", "hour", "day", or "month". This determines the
            buckets into which the property values that you segment on are
            placed. The default value is "day".
        - in: query
          name: interval
          schema:
            type: integer
          description: >-
            Optional parameter in lieu of 'unit' when 'type' is not 'general'.
            Determines the number of days your results are bucketed into can be
            used with or without 'from_date' and 'to_date' parameters.
        - $ref: '#/components/parameters/where'
        - in: query
          name: limit
          schema:
            type: integer
          description: >-
            Return the top property values. Defaults to 60. Maximum value
            10,000. This parameter does nothing if "on" is not specified.
        - in: query
          name: type
          schema:
            type: string
            enum:
              - general
              - unique
              - average
          description: >-
            This can be "general", "unique", or "average". If this is set to
            "unique", we return the unique count of events or property values.
            If set to "general", we return the total, including repeats. If set
            to "average", we return the average count. The default value is
            "general".
        - in: query
          name: format
          schema:
            type: string
            enum:
              - csv
            description: Can be set to "csv".
      responses:
        '200':
          description: Success.
          content:
            application/json:
              examples:
                example:
                  value:
                    data:
                      series:
                        - '2011-08-08'
                        - '2011-08-09'
                        - '2011-08-06'
                        - '2011-08-07'
                      values:
                        Signed up:
                          '2011-08-06': 147
                          '2011-08-07': 146
                          '2011-08-08': 776
                          '2011-08-09': 1376
                    legend_size: 1
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      series:
                        $ref: '#/components/schemas/series'
                      values:
                        type: object
                        additionalProperties:
                          description: >-
                            A mapping of the date to the number of specified
                            events that took place. (ex. {"2010-05-30": 6})
                  legend_size:
                    type: integer
                    description: List of all dates.
components:
  parameters:
    workspaceId:
      in: query
      name: workspace_id
      schema:
        type: integer
      description: The id of the workspace if applicable.
    eventName:
      in: query
      name: event
      schema:
        type: string
      description: >-
        The event that you wish to get data for. Note: this is a single event
        name, not an array.
      required: true
    'on':
      in: query
      name: 'on'
      schema:
        type: string
      description: >-
        The property expression to segment the event on. See the [expression to
        segment](/reference/segmentation-expressions) below.
    where:
      in: query
      name: where
      schema:
        type: string
      description: >-
        An expression to filter events by. See the [expression to
        segment](/reference/segmentation-expressions) below.
  schemas:
    series:
      type: array
      items:
        type: string
        description: All dates we have data for in the response.
  securitySchemes:
    ServiceAccount:
      type: http
      scheme: basic
      description: Service Account
    ProjectSecret:
      type: http
      scheme: basic
      description: Project Secret

````