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

# Count findings

> Count findings by severity, state and repository.

Counts findings using the same filters as [List findings](https://docs.hacktron.ai/api-reference/findings/list-findings.md), without requiring you to fetch every page. The response includes the total and counts by severity, state and repository. Severity and state counts include zero values. Repositories appear in order of finding count, highest first.

> [!NOTE]
>
> **Scope required**: `read`


## OpenAPI

````yaml GET /findings/counts
openapi: 3.0.0
info:
  title: Hacktron REST API
  description: Public REST API for programmatic access to Hacktron
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hacktron.ai/v1
security:
  - api-key: []
tags: []
paths:
  /findings/counts:
    get:
      tags:
        - REST API - Findings
      summary: >-
        Count findings matching the list filters, by severity, state and
        repository
      operationId: RestFindingController_counts
      parameters:
        - name: severity
          required: false
          in: query
          schema:
            type: string
            enum:
              - critical
              - high
              - medium
              - low
              - info
        - name: state
          required: false
          in: query
          schema:
            type: string
            enum:
              - open
              - true_positive
              - false_positive
              - accepted_risk
              - resolved
              - closed
        - name: scan_id
          required: false
          in: query
          schema:
            type: string
        - name: scan_type
          required: false
          in: query
          description: Filter by scan type across all scans associated with the finding.
          schema:
            type: string
            enum:
              - pr
              - full
        - name: repo_url
          required: false
          in: query
          description: >-
            Filter by repository URL. Case-insensitive; a trailing slash or .git
            suffix is ignored.
          schema:
            type: string
        - name: found_since
          required: false
          in: query
          description: Only include findings discovered on/after this ISO 8601 timestamp.
          schema:
            type: string
        - name: found_until
          required: false
          in: query
          description: Only include findings discovered before this ISO 8601 timestamp.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestFindingCountsResponseDto'
components:
  schemas:
    RestFindingCountsResponseDto:
      type: object
      properties:
        total:
          type: number
        by_severity:
          $ref: '#/components/schemas/RestSeverityCountsDto'
        by_state:
          $ref: '#/components/schemas/RestStateCountsDto'
        by_repository:
          description: Most findings first
          type: array
          items:
            $ref: '#/components/schemas/RestRepositoryFindingCountsDto'
      required:
        - total
        - by_severity
        - by_state
        - by_repository
    RestSeverityCountsDto:
      type: object
      properties:
        critical:
          type: number
        high:
          type: number
        medium:
          type: number
        low:
          type: number
        info:
          type: number
      required:
        - critical
        - high
        - medium
        - low
        - info
    RestStateCountsDto:
      type: object
      properties:
        open:
          type: number
        true_positive:
          type: number
        false_positive:
          type: number
        accepted_risk:
          type: number
        resolved:
          type: number
        closed:
          type: number
      required:
        - open
        - true_positive
        - false_positive
        - accepted_risk
        - resolved
        - closed
    RestRepositoryFindingCountsDto:
      type: object
      properties:
        repository:
          type: string
          nullable: true
          description: Repository URL, or null for findings with no repository
        total:
          type: number
        by_severity:
          $ref: '#/components/schemas/RestSeverityCountsDto'
      required:
        - repository
        - total
        - by_severity
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-Api-Key

````

## Related topics

- [Get Started](https://docs.hacktron.ai/mcp/get-started.md)
- [Get finding](https://docs.hacktron.ai/api-reference/findings/get-finding.md)
- [Findings and feedback](https://docs.hacktron.ai/code-review/findings-feedback.md)
- [Changelog](https://docs.hacktron.ai/changelog.md)
- [Hacktron in Slack](https://docs.hacktron.ai/platform/slack-assistant.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.