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

# Get task analytics for a date range

> Returns completion stats, priority breakdown, daily stats, and current streak for the given date range. Max 366 days.



## OpenAPI

````yaml https://znift.com/api/v1/openapi.json get /api/v1/tasks/analytics
openapi: 3.1.0
info:
  title: Znift Tasks API
  version: 1.0.0
  description: >-
    Public REST API for managing Znift tasks. Designed for AI agents, CLI tools,
    and automation. Authenticate with an API key via the x-api-key header.
servers:
  - url: https://znift.com
    description: Znift Production API
security:
  - apiKey: []
paths:
  /api/v1/tasks/analytics:
    get:
      summary: Get task analytics for a date range
      description: >-
        Returns completion stats, priority breakdown, daily stats, and current
        streak for the given date range. Max 366 days.
      operationId: getTaskAnalytics
      parameters:
        - name: startDate
          in: query
          required: true
          schema:
            type: string
            format: date
          description: Start date (YYYY-MM-DD)
        - name: endDate
          in: query
          required: true
          schema:
            type: string
            format: date
          description: End date (YYYY-MM-DD)
      responses:
        '200':
          description: Analytics data
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalTasks:
                    type: number
                  completedTasks:
                    type: number
                  completionRate:
                    type: number
                    description: Percentage 0-100
                  currentStreak:
                    type: number
                    description: Consecutive days with completed tasks
                  priorityBreakdown:
                    type: object
                  dailyStats:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                        total:
                          type: number
                        completed:
                          type: number
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with znift_ prefix. Create one in Profile > API Keys.

````