Skip to main content
GET
/
analytics
/
comparison
curl -X GET "https://api.hitler.app/analytics/comparison?timeRange=30d" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "taskMetrics": {
    "totalCreated": 245,
    "totalCompleted": 198,
    "completionRate": 81,
    "avgCompletionTime": 24,
    "overdueCount": 12
  },
  "moodMetrics": {
    "averageScore": 3.7,
    "totalResponses": 156,
    "trend": "up",
    "distribution": [...]
  },
  "teamMetrics": {
    "activeUsers": 18,
    "totalUsers": 24,
    "topPerformers": [...]
  },
  "flagMetrics": {
    "total": 15,
    "bySeverity": [...],
    "resolved": 11,
    "pending": 4
  },
  "comparisons": {
    "tasksCreated": {
      "current": 245,
      "previous": 210,
      "change": 35,
      "changePercent": 17,
      "trend": "up"
    },
    "tasksCompleted": {
      "current": 198,
      "previous": 175,
      "change": 23,
      "changePercent": 13,
      "trend": "up"
    },
    "completionRate": {
      "current": 81,
      "previous": 83,
      "change": -2,
      "changePercent": -2,
      "trend": "stable"
    },
    "moodAverage": {
      "current": 3.7,
      "previous": 3.4,
      "change": 0.3,
      "changePercent": 9,
      "trend": "up"
    },
    "activeUsers": {
      "current": 18,
      "previous": 16,
      "change": 2,
      "changePercent": 13,
      "trend": "up"
    },
    "flagsCreated": {
      "current": 15,
      "previous": 22,
      "change": -7,
      "changePercent": -32,
      "trend": "down"
    }
  }
}

Get Analytics with Comparison

Returns comprehensive analytics data along with comparisons to the previous period of the same length.
This endpoint is only accessible to users with manager or admin roles.

Request

Authorization
string
required
Bearer token from authentication
timeRange
string
default:"30d"
Time range for analytics. Options: 7d, 30d, 90dThe comparison is made against the previous period of the same length. For example, 30d compares the last 30 days to the 30 days before that.

Response

The response includes all fields from the base analytics endpoint, plus a comparisons object.

Comparison Object

Each comparison contains:
comparisons.*.current
number
Current period value
comparisons.*.previous
number
Previous period value
comparisons.*.change
number
Absolute change (current - previous)
comparisons.*.changePercent
number
Percentage change from previous period
comparisons.*.trend
string
Trend indicator: up, down, or stable
  • up: changePercent > 5%
  • down: changePercent < -5%
  • stable: -5% to +5%

Available Comparisons

FieldDescription
tasksCreatedTotal tasks created
tasksCompletedTotal tasks completed
completionRateTask completion percentage
moodAverageAverage mood score
activeUsersNumber of active users
flagsCreatedTotal flags raised
curl -X GET "https://api.hitler.app/analytics/comparison?timeRange=30d" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "taskMetrics": {
    "totalCreated": 245,
    "totalCompleted": 198,
    "completionRate": 81,
    "avgCompletionTime": 24,
    "overdueCount": 12
  },
  "moodMetrics": {
    "averageScore": 3.7,
    "totalResponses": 156,
    "trend": "up",
    "distribution": [...]
  },
  "teamMetrics": {
    "activeUsers": 18,
    "totalUsers": 24,
    "topPerformers": [...]
  },
  "flagMetrics": {
    "total": 15,
    "bySeverity": [...],
    "resolved": 11,
    "pending": 4
  },
  "comparisons": {
    "tasksCreated": {
      "current": 245,
      "previous": 210,
      "change": 35,
      "changePercent": 17,
      "trend": "up"
    },
    "tasksCompleted": {
      "current": 198,
      "previous": 175,
      "change": 23,
      "changePercent": 13,
      "trend": "up"
    },
    "completionRate": {
      "current": 81,
      "previous": 83,
      "change": -2,
      "changePercent": -2,
      "trend": "stable"
    },
    "moodAverage": {
      "current": 3.7,
      "previous": 3.4,
      "change": 0.3,
      "changePercent": 9,
      "trend": "up"
    },
    "activeUsers": {
      "current": 18,
      "previous": 16,
      "change": 2,
      "changePercent": 13,
      "trend": "up"
    },
    "flagsCreated": {
      "current": 15,
      "previous": 22,
      "change": -7,
      "changePercent": -32,
      "trend": "down"
    }
  }
}