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

# Get project transaction statistics



## OpenAPI

````yaml /OPENAPI.yaml get /api/projects/{project_uid}/stats
openapi: 3.0.3
info:
  title: Redf Backend API
  version: 1.0.0
  description: >
    OpenAPI specification for the current HTTP backend exposed by the Phoenix
    router. The spec reflects the routes and controller behaviour currently
    implemented in `blockchain_app/lib/blockchain_app_web/router.ex`.
servers:
  - url: http://localhost:4000
    description: Local development
security: []
tags:
  - name: Health
  - name: Networks
  - name: Projects
  - name: Transactions
  - name: Widgets
paths:
  /api/projects/{project_uid}/stats:
    get:
      tags:
        - Projects
      summary: Get project transaction statistics
      operationId: getProjectStats
      parameters:
        - $ref: '#/components/parameters/ProjectUid'
        - in: query
          name: from
          schema:
            type: integer
          description: Start of range in epoch seconds
        - in: query
          name: to
          schema:
            type: integer
          description: End of range in epoch seconds
        - $ref: '#/components/parameters/StatsPeriod'
      responses:
        '200':
          description: Aggregated stats for project transactions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectStatsResponse'
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ProjectUid:
      in: path
      name: project_uid
      required: true
      schema:
        type: string
        format: uuid
      description: Public project UUID
    StatsPeriod:
      in: query
      name: period
      schema:
        type: string
        enum:
          - 1h
          - 24h
          - 7d
          - 1m
          - 1y
          - all
      description: Preset time range if `from`/`to` are omitted
  schemas:
    ProjectStatsResponse:
      type: object
      required:
        - status
        - project_uid
        - period_from
        - period_to
        - stats
      properties:
        status:
          type: string
          enum:
            - ok
        project_uid:
          type: string
          format: uuid
        period_from:
          type: integer
          nullable: true
        period_to:
          type: integer
        stats:
          $ref: '#/components/schemas/ProjectStats'
    ErrorResponse:
      type: object
      description: >
        Generic error payload used by the API. Some handlers return `error`,
        while validation and internal checker failures may return only `errors`
        or `reason`.
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - error
        error:
          type: string
          example: invalid_request
        reason:
          type: string
          nullable: true
        detail:
          type: string
          nullable: true
        field:
          oneOf:
            - type: string
            - type: integer
          nullable: true
        currency:
          type: string
          nullable: true
        missing:
          type: array
          items:
            type: string
        errors:
          $ref: '#/components/schemas/ValidationErrors'
        message:
          type: string
          nullable: true
        constraint:
          type: string
          nullable: true
        tx_status:
          type: string
          nullable: true
        project_uid:
          type: string
          nullable: true
        widget_id:
          oneOf:
            - type: string
            - type: integer
          nullable: true
        expected:
          type: object
          additionalProperties: true
      additionalProperties: true
    ProjectStats:
      type: object
      required:
        - total_count
        - total_sum
        - success_count
        - failed_count
      properties:
        total_count:
          type: integer
          example: 12
        total_sum:
          $ref: '#/components/schemas/DecimalString'
        success_count:
          type: integer
          example: 10
        failed_count:
          type: integer
          example: 2
    ValidationErrors:
      type: object
      description: Map of field names to validation error messages
      additionalProperties:
        type: array
        items:
          type: string
    DecimalString:
      type: string
      example: '10.50'
      description: Decimal amount as returned by JSON encoding

````