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

# Get Miner Stats

> Returns aggregate miner classification counts and mining-mode and model distributions for a farm.

`by_type` counts are independent. A sleeping miner with a fault appears in both `abnormal` and `sleep`. Online miners equal `total - stale`.

Use Search Miners to retrieve miners behind a count:
- `healthy`: `status.nin = ["stale"]`, `has_anomaly = false`, `mining_mode.nin = ["sleep"]`
- `abnormal`: `status.nin = ["stale"]`, `has_anomaly = true`
- `sleep`: `status.nin = ["stale"]`, `mining_mode.in = ["sleep"]`
- `stale`: `status.in = ["stale"]`
- abnormal subtype: `status.nin = ["stale"]`, `anomaly_filters = ["fan"]` (replace `fan` with the required subtype)



## OpenAPI

````yaml /api-reference/openapi-legacy.json get /private-api/v1/{workspace_id}/farms/{farm_id}/miners/stats
openapi: 3.1.0
info:
  title: Nonce Private API
  description: |-
    Nonce Private API documentation - Internal endpoints for system integration

    Generated by NestJS Swagger Module with nestjs-zod
    Scope: Private API endpoints only (/private-api/*)
    Do not edit this file manually - regenerate with: pnpm run docs:openapi
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.nonce.app
    description: Production server
security: []
tags: []
paths:
  /private-api/v1/{workspace_id}/farms/{farm_id}/miners/stats:
    get:
      tags:
        - Miners
      summary: Get Miner Stats
      description: >-
        Returns aggregate miner classification counts and mining-mode and model
        distributions for a farm.


        `by_type` counts are independent. A sleeping miner with a fault appears
        in both `abnormal` and `sleep`. Online miners equal `total - stale`.


        Use Search Miners to retrieve miners behind a count:

        - `healthy`: `status.nin = ["stale"]`, `has_anomaly = false`,
        `mining_mode.nin = ["sleep"]`

        - `abnormal`: `status.nin = ["stale"]`, `has_anomaly = true`

        - `sleep`: `status.nin = ["stale"]`, `mining_mode.in = ["sleep"]`

        - `stale`: `status.in = ["stale"]`

        - abnormal subtype: `status.nin = ["stale"]`, `anomaly_filters =
        ["fan"]` (replace `fan` with the required subtype)
      operationId: getMinerStats
      parameters:
        - name: workspace_id
          required: true
          in: path
          schema:
            type: string
        - name: farm_id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved miner stats
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: Indicates if the request was successful
                  data:
                    type: object
                    properties:
                      theo:
                        type:
                          - number
                          - 'null'
                      total:
                        type: number
                      by_type:
                        type: object
                        properties:
                          healthy:
                            type: number
                          abnormal:
                            type: number
                          sleep:
                            type: number
                          stale:
                            type: number
                        required:
                          - healthy
                          - abnormal
                          - sleep
                          - stale
                      by_abnormal_type:
                        type: object
                        properties:
                          hashboard:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          temperature:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          fan:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          network:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          pool:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          power:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          control_board:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          firmware:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          low_hashrate:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          unknown:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                        required:
                          - hashboard
                          - temperature
                          - fan
                          - network
                          - pool
                          - power
                          - control_board
                          - firmware
                          - low_hashrate
                          - unknown
                      mining_mode:
                        type: array
                        items:
                          type: object
                          properties:
                            mode:
                              type: string
                              description: Mining mode name
                            mining_mode_preset:
                              description: >-
                                Third-party firmware preset name when the mining
                                mode is preset
                              type:
                                - string
                                - 'null'
                            count:
                              type: number
                              description: Number of online miners in this mode
                          required:
                            - mode
                            - mining_mode_preset
                            - count
                          title: Farm Mining Mode Count
                      miner_model:
                        type: array
                        items:
                          type: object
                          properties:
                            model:
                              description: Miner model name
                              type:
                                - string
                                - 'null'
                            theoretical_hashrate:
                              type:
                                - number
                                - 'null'
                            submodel:
                              type:
                                - string
                                - 'null'
                            count:
                              type: number
                              description: Number of online miners of this model
                            average_expected_hashrate:
                              description: Average expected hashrate in H/s
                              type:
                                - number
                                - 'null'
                          required:
                            - model
                            - theoretical_hashrate
                            - submodel
                            - count
                            - average_expected_hashrate
                          title: Farm Miner Model Count
                    required:
                      - theo
                      - total
                      - by_type
                      - by_abnormal_type
                      - mining_mode
                      - miner_model
                    title: Farm Miner Stats
                    description: Aggregate miner counts and distributions for a farm.
                  error:
                    type: 'null'
                    example: null
                    description: Error object (null on success)
                required:
                  - success
                  - data
                  - error
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: VALIDATION_ERROR
                  message: Validation failed
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
        '403':
          description: Forbidden - Valid API key but insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: FORBIDDEN
                  message: Access denied to workspace
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: NOT_FOUND
                  message: Resource not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: Internal server error
      security:
        - clerk-api-key: []
components:
  securitySchemes:
    clerk-api-key:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Clerk Machine API Key for authentication

````