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

# Compare multiple campaigns

> Compare multiple campaigns



## OpenAPI

````yaml get /api/v1/analytics/campaign/compare
openapi: 3.0.3
info:
  title: Xem API
  version: '1.0'
  description: Comprehensive API server for Xem email marketing platform
  contact: {}
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.xem.email/api/v1
    description: Production server
  - url: http://localhost:8080/api/v1
    description: Development server
security: []
tags:
  - name: Authentication
    description: User authentication and authorization endpoints
  - name: Teams
    description: Team management and collaboration features
  - name: Campaigns
    description: Email campaign creation, management, and tracking
  - name: Analytics
    description: Campaign analytics, audience insights, and performance metrics
  - name: Contacts
    description: Contact management and mailing list operations
  - name: Templates
    description: Email template management and customization
  - name: Automations
    description: Email automation workflows and triggers
  - name: SMTP
    description: SMTP configuration and email delivery settings
  - name: IMAP
    description: IMAP configuration for email inbox management
  - name: Webhooks
    description: Webhook management for real-time event notifications
  - name: Files
    description: File upload and management for attachments and media
  - name: Domains
    description: Domain management for email authentication
  - name: API Keys
    description: API key management for programmatic access
paths:
  /api/v1/analytics/campaign/compare:
    get:
      tags: []
      summary: Compare multiple campaigns
      description: Compare multiple campaigns
      parameters:
        - name: campaignIds
          in: query
          description: Campaign IDs
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Campaign analytics
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/internal_handlers.EmailAnalytics'
        '400':
          description: Validation error or campaignIds missing
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
      security: []
components:
  schemas:
    internal_handlers.EmailAnalytics:
      description: Email analytics data
      type: object
      properties:
        averageReadTime:
          description: Average time between open and click
          allOf:
            - $ref: '#/components/schemas/time.Duration'
        bounceCount:
          type: integer
        browserBreakdown:
          type: object
          additionalProperties:
            type: integer
        cityBreakdown:
          type: object
          additionalProperties:
            type: integer
        clickCount:
          type: integer
        clickRate:
          type: number
        clickedLinks:
          description: 🔗 Link Analytics
          type: array
          items:
            $ref: '#/components/schemas/internal_handlers.LinkAnalytics'
        complaintCount:
          type: integer
        dayOfWeekBreakdown:
          description: Day name -> count
          type: object
          additionalProperties:
            type: integer
        deviceBreakdown:
          description: 📱 Device & Browser Analytics
          type: object
          additionalProperties:
            type: integer
        engagementScore:
          description: 🎯 Engagement Metrics
          type: number
        firstOpenTime:
          description: Time to first open
          allOf:
            - $ref: '#/components/schemas/time.Duration'
        geoBreakdown:
          description: 🌍 Geographic Analytics
          type: object
          additionalProperties:
            type: integer
        hourlyBreakdown:
          description: Hour (0-23) -> count
          type: object
          additionalProperties:
            type: integer
        industryAvgClickRate:
          type: number
        industryAvgOpenRate:
          description: 📈 Comparative Metrics
          type: number
        openCount:
          description: 📊 Basic Metrics
          type: integer
        openRate:
          type: number
        osBreakdown:
          type: object
          additionalProperties:
            type: integer
        regionBreakdown:
          type: object
          additionalProperties:
            type: integer
        repeatClicks:
          description: Number of times same user clicked
          type: integer
        repeatOpens:
          description: 🔄 Retention Metrics
          type: integer
        timelineData:
          description: ⏰ Time-based Analytics
          type: array
          items:
            $ref: '#/components/schemas/internal_handlers.TimelineDataPoint'
        uniqueClicks:
          type: integer
        uniqueOpens:
          type: integer
    time.Duration:
      type: integer
      format: int64
      enum:
        - -9223372036854776000
        - 9223372036854776000
        - 1
        - 1000
        - 1000000
        - 1000000000
        - 60000000000
        - 3600000000000
      x-enum-varnames:
        - minDuration
        - maxDuration
        - Nanosecond
        - Microsecond
        - Millisecond
        - Second
        - Minute
        - Hour
    internal_handlers.LinkAnalytics:
      type: object
      properties:
        averageTimeToClick:
          $ref: '#/components/schemas/time.Duration'
        clickCount:
          type: integer
        clickRate:
          type: number
        deviceBreakdown:
          type: object
          additionalProperties:
            type: integer
        firstClickTime:
          type: string
        lastClickTime:
          type: string
        uniqueClicks:
          type: integer
        url:
          type: string
    internal_handlers.TimelineDataPoint:
      type: object
      properties:
        browser:
          type: string
        count:
          type: integer
        country:
          type: string
        deviceType:
          type: string
        eventType:
          type: string
        timestamp:
          type: string
        uniqueCount:
          type: integer

````