OpenPanel Insights API

Query analytics data

OpenAPI Specification

openpanel-insights-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenPanel Event Insights API
  version: 1.0.0
  description: Legacy event ingestion (deprecated, use /track)
tags:
- name: Insights
  description: Query analytics data
paths:
  /insights/{projectId}/overview:
    get:
      tags:
      - Insights
      description: Get an overview of key metrics for the project (sessions, pageviews, bounce rate, duration).
      parameters:
      - schema:
          type: string
        in: query
        name: startDate
      - schema:
          type: string
        in: query
        name: endDate
      - schema:
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: string
          enum:
          - hour
          - day
          - week
          - month
        in: query
        name: interval
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/active_users:
    get:
      tags:
      - Insights
      description: Get rolling active user counts over the last N days.
      parameters:
      - schema:
          default: 7
          type: integer
          minimum: 1
          maximum: 90
        in: query
        name: days
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/retention:
    get:
      tags:
      - Insights
      description: Get weekly retention series data.
      parameters:
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/retention/cohort:
    get:
      tags:
      - Insights
      description: Get retention cohort data.
      parameters:
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/pages/top:
    get:
      tags:
      - Insights
      description: Get the top pages by pageviews for the given date range.
      parameters:
      - schema:
          type: string
        in: query
        name: startDate
      - schema:
          type: string
        in: query
        name: endDate
      - schema:
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/pages/entry_exit:
    get:
      tags:
      - Insights
      description: Get entry or exit pages ranked by session count.
      parameters:
      - schema:
          type: string
        in: query
        name: startDate
      - schema:
          type: string
        in: query
        name: endDate
      - schema:
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          default: entry
          type: string
          enum:
          - entry
          - exit
        in: query
        name: mode
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/pages/performance:
    get:
      tags:
      - Insights
      description: Get page-level performance metrics (bounce rate, avg duration, sessions).
      parameters:
      - schema:
          type: string
        in: query
        name: startDate
      - schema:
          type: string
        in: query
        name: endDate
      - schema:
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: string
        in: query
        name: search
      - schema:
          type: string
          enum:
          - sessions
          - pageviews
          - bounce_rate
          - avg_duration
        in: query
        name: sortBy
      - schema:
          type: string
          enum:
          - asc
          - desc
        in: query
        name: sortOrder
      - schema:
          default: 50
          type: integer
          minimum: 1
          maximum: 500
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/metrics:
    get:
      tags:
      - Insights
      description: Get aggregated website metrics including sessions, pageviews, and bounce rate.
      parameters:
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/live:
    get:
      tags:
      - Insights
      description: Get the current number of live (active) visitors.
      parameters:
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/pages:
    get:
      tags:
      - Insights
      description: Get top pages with pageview counts for the selected date range.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/referrer:
    get:
      tags:
      - Insights
      description: Get top values for the "referrer" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/referrer_name:
    get:
      tags:
      - Insights
      description: Get top values for the "referrer_name" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/referrer_type:
    get:
      tags:
      - Insights
      description: Get top values for the "referrer_type" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/utm_source:
    get:
      tags:
      - Insights
      description: Get top values for the "utm_source" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/utm_medium:
    get:
      tags:
      - Insights
      description: Get top values for the "utm_medium" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/utm_campaign:
    get:
      tags:
      - Insights
      description: Get top values for the "utm_campaign" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/utm_term:
    get:
      tags:
      - Insights
      description: Get top values for the "utm_term" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/utm_content:
    get:
      tags:
      - Insights
      description: Get top values for the "utm_content" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the filter
              value:
                type: array
                items:
                  anyOf:
                  - anyOf:
                    - anyOf:
                      - type: string
                      - type: number
                    - type: boolean
                  - type: 'null'
                description: The values to filter on
              cohortId:
                description: Cohort ID when using inCohort/notInCohort operators
                type: string
            required:
            - name
            - operator
            - value
        in: query
        name: filters
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: startDate
      - schema:
          anyOf:
          - type: string
          - type: 'null'
        in: query
        name: endDate
      - schema:
          default: 7d
          type: string
          enum:
          - 30min
          - lastHour
          - today
          - yesterday
          - 7d
          - 30d
          - 6m
          - 12m
          - monthToDate
          - lastMonth
          - yearToDate
          - lastYear
          - custom
        in: query
        name: range
      - schema:
          type: number
        in: query
        name: cursor
      - schema:
          default: 10
          type: number
        in: query
        name: limit
      - schema:
          type: string
        in: path
        name: projectId
        required: true
      responses:
        '200':
          description: Default Response
  /insights/{projectId}/region:
    get:
      tags:
      - Insights
      description: Get top values for the "region" dimension.
      parameters:
      - schema:
          default: []
          type: array
          items:
            type: object
            properties:
              id:
                description: Unique identifier for the filter
                type: string
              name:
                type: string
                description: The property name to filter on
              operator:
                type: string
                enum:
                - is
                - isNot
                - contains
                - doesNotContain
                - startsWith
                - endsWith
                - regex
                - isNull
                - isNotNull
                - gt
                - lt
                - gte
                - lte
                - inCohort
                - notInCohort
                description: The operator to use for the

# --- truncated at 32 KB (79 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openpanel/refs/heads/main/openapi/openpanel-insights-api-openapi.yml