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

# Get the statistics for the specified components



## OpenAPI

````yaml /api-reference/components-openapi.json post /v2/components/statistics
openapi: 3.0.0
info:
  title: SCANOSS Components Service
  description: Provides component intelligence services
  version: '2.0'
  contact:
    name: scanoss-components
    url: https://github.com/scanoss/components
    email: support@scanoss.com
servers:
  - url: https://api.scanoss.com
  - url: http://api.scanoss.com
security: []
tags:
  - name: Components
paths:
  /v2/components/statistics:
    post:
      tags:
        - Components
      summary: Get the statistics for the specified components
      operationId: Components_GetComponentStatistics
      requestBody:
        $ref: '#/components/requestBodies/v2ComponentsRequest'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ComponentsStatisticResponse'
        '404':
          description: Returned when the resource does not exist.
          content:
            application/json:
              schema:
                type: string
                format: string
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  requestBodies:
    v2ComponentsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v2ComponentsRequest'
      description: >-
        Represents a list of software component to be analyzed by SCANOSS API
        services.

        Allows analysis of multiple software components in a single API call,
        improving performance over individual requests.
      required: true
  schemas:
    v2ComponentsStatisticResponse:
      type: object
      example:
        component_statistics:
          - purl: pkg:github/scanoss/engine@5.0.0
            version: 5.0.0
            statistics:
              total_source_files: 156
              total_lines: 25430
              total_blank_lines: 3420
              languages:
                - name: C
                  files: 89
                - name: C Header
                  files: 45
        status:
          status: SUCCESS
          message: Component statistics successfully retrieved
      properties:
        component_statistics:
          type: array
          items:
            $ref: >-
              #/components/schemas/ComponentsStatisticResponseComponentStatistics
          title: Component statistic details
        status:
          $ref: '#/components/schemas/v2StatusResponse'
      title: Component Statistics response data (JSON payload)
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    v2ComponentsRequest:
      type: object
      example:
        components:
          - purl: pkg:github/scanoss/engine@1.0.0
          - purl: pkg:github/scanoss/scanoss.py@v1.30.0
      properties:
        components:
          type: array
          items:
            $ref: '#/components/schemas/v2ComponentRequest'
          title: Array of component requests to analyze
      description: >-
        Represents a list of software component to be analyzed by SCANOSS API
        services.

        Allows analysis of multiple software components in a single API call,
        improving performance over individual requests.
      required:
        - components
    ComponentsStatisticResponseComponentStatistics:
      type: object
      properties:
        purl:
          type: string
        version:
          type: string
        statistics:
          $ref: '#/components/schemas/v2CompStatistic'
    v2StatusResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/v2StatusCode'
        message:
          type: string
          title: Status message
        db:
          $ref: '#/components/schemas/StatusResponseDB'
        server:
          $ref: '#/components/schemas/StatusResponseServer'
      description: Detailed response details.
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    v2ComponentRequest:
      type: object
      example:
        purl: pkg:github/scanoss/engine@1.0.0
      properties:
        purl:
          type: string
          description: Package URL identifying the component to analyze.
        requirement:
          type: string
          description: >-
            Version constraint for component resolution when PURL lacks explicit
            version.
      description: >-
        Represents a software component to be analyzed by SCANOSS API services.

        Combines a Package URL for component identification with optional
        version constraints for resolution.
      required:
        - purl
    v2CompStatistic:
      type: object
      properties:
        total_source_files:
          type: integer
          format: int32
        total_lines:
          type: integer
          format: int32
        total_blank_lines:
          type: integer
          format: int32
        languages:
          type: array
          items:
            $ref: '#/components/schemas/CompStatisticLanguage'
    v2StatusCode:
      type: string
      enum:
        - UNSPECIFIED
        - SUCCESS
        - SUCCEEDED_WITH_WARNINGS
        - WARNING
        - FAILED
      default: UNSPECIFIED
      description: Status code Enum.
    StatusResponseDB:
      type: object
      properties:
        schema_version:
          type: string
          title: Semantic schema version (e.g., 'v1.0.0')
        created_at:
          type: string
          title: When this DB was built (ISO 8601 format)
      description: Database version information.
    StatusResponseServer:
      type: object
      properties:
        version:
          type: string
          title: Semantic version (e.g., 'v1.0.0')
      description: Server information.
    CompStatisticLanguage:
      type: object
      properties:
        name:
          type: string
        files:
          type: integer
          format: int32

````