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

# Statistics

Returns statistics for the project: `total_codes`, `used_codes`, `unused_codes`, `disabled_codes`, `expired_codes`, `usage_rate`, and `recent_verifications` (recent verification records). Same as the `statistics` field in [Get project](/en/api-reference/endpoint/get-project); this endpoint provides a more complete list of recent verifications.


## OpenAPI

````yaml en/api-reference/endpoint/en/api-reference/openapi.json get /api/v1/projects/{project_id}/statistics
openapi: 3.1.0
info:
  title: CodeGate SDK API
  description: CodeGate 激活码管理服务 SDK API - 使用 API Key + HMAC-SHA256 签名认证
  license:
    name: Apache-2.0
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: CodeGate API 服务器
security:
  - apiKeyAuth: []
paths:
  /api/v1/projects/{project_id}/statistics:
    get:
      summary: 获取项目统计信息
      operationId: getStatistics
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 统计信息
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statistics'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Statistics:
      type: object
      properties:
        project_id:
          type: string
        total_codes:
          type: integer
        used_codes:
          type: integer
        unused_codes:
          type: integer
        disabled_codes:
          type: integer
        expired_codes:
          type: integer
        usage_rate:
          type: number
        recent_verifications:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              verified_at:
                type: integer
              verified_by:
                type: string
  responses:
    Unauthorized:
      description: 认证失败（API Key、签名、时间戳、项目状态）
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
    Forbidden:
      description: project_id 与 API Key 绑定的项目不匹配
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
    NotFound:
      description: 资源不存在
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key + X-Timestamp + X-Signature（HMAC-SHA256）

````