> ## 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 CPEs (Common Platform Enumeration) associated with multiple software components.

> Returns Common Platform Enumeration identifiers for multiple components in a single request.
CPEs are used to identify IT platforms in vulnerability databases and enable
vulnerability scanning and assessment.

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



## OpenAPI

````yaml /api-reference/vulnerabilities-openapi.json post /v2/vulnerabilities/cpes/components
openapi: 3.0.0
info:
  title: SCANOSS Vulnerability Service
  description: >-
    Vulnerability service provides vulnerability intelligence for software
    components.
  version: '2.0'
  contact:
    name: scanoss-vulnerabilities
    url: https://github.com/scanoss/vulnerabilities
    email: support@scanoss.com
servers:
  - url: http://api.scanoss.com
  - url: https://api.scanoss.com
security: []
tags:
  - name: Vulnerabilities
paths:
  /v2/vulnerabilities/cpes/components:
    post:
      tags:
        - Vulnerabilities
      summary: >-
        Get CPEs (Common Platform Enumeration) associated with multiple software
        components.
      description: >-
        Returns Common Platform Enumeration identifiers for multiple components
        in a single request.

        CPEs are used to identify IT platforms in vulnerability databases and
        enable

        vulnerability scanning and assessment.


        See:
        https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/vulnerabilities/v2/README.md?tab=readme-ov-file#getcomponentscpes
      operationId: Vulnerabilities_GetComponentsCpes
      requestBody:
        $ref: '#/components/requestBodies/v2ComponentsRequest'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ComponentsCpesResponse'
        '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:
    v2ComponentsCpesResponse:
      type: object
      example:
        components:
          - purl: pkg:github/scanoss/engine
            requirement: 1.0.0
            version: 1.0.0
            cpes:
              - cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*
          - purl: pkg:github/scanoss/scanoss.py@v1.30.0
            requirement: ''
            version: v1.30.0
            cpes:
              - cpe:2.3:a:scanoss:scanoss.py:1.30.0:*:*:*:*:*:*:*
        status:
          status: SUCCESS
          message: CPEs Successfully retrieved
      properties:
        components:
          type: array
          items:
            $ref: '#/components/schemas/v2ComponentCpesInfo'
          title: CPE information for each component in the batch
        status:
          $ref: '#/components/schemas/v2StatusResponse'
      description: >-
        Success example. For error cases, each component block reports the
        processing status via info_message and info_code. Example:
        {"components":[{"purl":"pkg:github/scanoss/engine","requirement":"1.0.0","version":"1.0.0","cpes":["cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*"]},{"purl":"pkg:github/unknown/component","requirement":"","version":"","cpes":[],"info_message":"Component
        not found in
        database","info_code":"COMPONENT_NOT_FOUND"}],"status":{"status":"SUCCESS","message":"Request
        processed"}}
    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
    v2ComponentCpesInfo:
      type: object
      properties:
        purl:
          type: string
          description: >-
            Package URL (PURL) uniquely identifying the component. See Common
            API Types documentation for format and resolution logic.
        version:
          type: string
          title: Specific version of the component that was analyzed
        requirement:
          type: string
          title: >-
            Echoes the client's version constraint from the request. See Common
            API Types documentation for resolution logic
        cpes:
          type: array
          items:
            type: string
          title: >-
            List of Common Platform Enumeration identifiers associated with this
            component
        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 CPE 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: |-
        Common Platform Enumeration information for a specific component.

        Contains CPE identifiers that can be used to match the component
        against vulnerability databases and security advisories.
    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
    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.

````