> ## 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 license information for multiple software components in a single request.

> Examines source code, license files, and package metadata to determine which licenses apply to each component.
Returns license data in both individual SPDX license and SPDX expressions when determinable.

See https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/licenses/v2/README.md?tab=readme-ov-file#getcomponentslicenses



## OpenAPI

````yaml /api-reference/licenses-openapi.json post /v2/licenses/components
openapi: 3.0.0
info:
  title: SCANOSS License Service
  description: License service provides license intelligence for software components.
  version: '2.0'
  contact:
    name: scanoss-licenses
    url: https://github.com/scanoss/licenses
    email: support@scanoss.com
servers:
  - url: http://api.scanoss.com
  - url: https://api.scanoss.com
security: []
tags:
  - name: License
paths:
  /v2/licenses/components:
    post:
      tags:
        - License
      summary: >-
        Get license information for multiple software components in a single
        request.
      description: >-
        Examines source code, license files, and package metadata to determine
        which licenses apply to each component.

        Returns license data in both individual SPDX license and SPDX
        expressions when determinable.


        See
        https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/licenses/v2/README.md?tab=readme-ov-file#getcomponentslicenses
      operationId: License_GetComponentsLicenses
      requestBody:
        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
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ComponentsLicenseResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  schemas:
    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
    v2ComponentsLicenseResponse:
      type: object
      example:
        components:
          - purl: pkg:github/scanoss/engine@1.0.0
            requirement: ''
            version: 1.0.0
            statement: GPL-2.0
            licenses:
              - id: GPL-2.0
                full_name: GNU General Public License v2.0 only
                is_spdx_approved: true
                url: https://spdx.org/licenses/GPL-2.0-only.html
            url: https://github.com/scanoss/engine
          - purl: pkg:github/scanoss/scanoss.py@v1.30.0
            requirement: ''
            version: v1.30.0
            statement: MIT
            licenses:
              - id: MIT
                full_name: MIT License
                is_spdx_approved: true
                url: https://spdx.org/licenses/MIT.html
            url: https://github.com/scanoss/scanoss.py
        status:
          status: SUCCESS
          message: Licenses Successfully retrieved
      properties:
        components:
          type: array
          items:
            $ref: '#/components/schemas/v2ComponentLicenseInfo'
          title: License info for each component in the batch
        status:
          $ref: '#/components/schemas/v2StatusResponse'
      description: >-
        Success example. For error cases, each component block reports the
        failure via info_message and info_code. Example:
        {\"components\":[{\"purl\":\"pkg:github/scanoss/unknown-component\",\"requirement\":\"\",\"version\":\"\",\"statement\":\"\",\"licenses\":[],\"url\":\"\",\"info_message\":\"Component
        version not
        found\",\"info_code\":\"VERSION_NOT_FOUND\"}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Success\"}}
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    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
    v2ComponentLicenseInfo:
      type: object
      properties:
        purl:
          type: string
          description: >-
            Package URL (PURL) uniquely identifying the component. See Common
            API Types documentation for format and resolution logic.
        requirement:
          type: string
          title: >-
            Echoes the client's version constraint from the request. See Common
            API Types documentation for resolution logic
        version:
          type: string
          title: Specific version of the component that was analyzed
        statement:
          type: string
          title: >-
            SPDX expression when licensing terms are clearly determinable from
            source analysis
        licenses:
          type: array
          items:
            $ref: '#/components/schemas/v2LicenseInfo'
          title: Individual licenses identified in the component
        url:
          type: string
          title: Component URL
        info_message:
          type: string
          description: Status message describing the outcome of processing this component.
        info_code:
          type: string
          description: |-
            Status code identifying the outcome of processing this component.

            Possible values:
              - "INVALID_PURL":        The provided Package URL (PURL) is invalid or malformed.
              - "COMPONENT_NOT_FOUND": The requested component could not be found in the database.
              - "NO_INFO":             No license information is available for the requested component.
              - "INVALID_SEMVER":      The provided semantic version (SemVer) is invalid or malformed.
              - "VERSION_NOT_FOUND":   The specific component version could not be found.
      description: >-
        License information for a specific component identified by PURL and
        version.
    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: {}
    v2LicenseInfo:
      type: object
      example:
        id: GPL-2.0
        full_name: GNU General Public License v2.0 only
        is_spdx_approved: true
        url: https://spdx.org/licenses/GPL-2.0-only.html
      properties:
        id:
          type: string
          title: |-
            License identifier:
             - For SPDX registry licenses: Standard SPDX ID
             - For non-registry licenses: licenseRef-<custom_license_name>
        full_name:
          type: string
          title: >-
            Best human-readable license name (normalized when possible)

            - For SPDX licenses: Official SPDX name (e.g., "MIT License", "GNU
            General Public License v2.0 only")

            - For non SPDX licenses: Best normalized name from SCANOSS database
            or original statement
        is_spdx_approved:
          type: boolean
          title: Indicates whether the license is approved by the SPDX License List
        url:
          type: string
          title: >-
            URL to the license text or reference page (e.g., SPDX license page
            or original license source)
      description: >-
        Individual license identification with SPDX ID and human-readable name.


        Provides basic license information including standardized identifiers
        and 

        human-readable names for discovered licenses in software components.
    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.

````