Get CPEs (Common Platform Enumeration) associated with a single software component.
curl --request GET \
--url http://api.scanoss.com/v2/vulnerabilities/cpes/componentimport requests
url = "http://api.scanoss.com/v2/vulnerabilities/cpes/component"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://api.scanoss.com/v2/vulnerabilities/cpes/component', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://api.scanoss.com/v2/vulnerabilities/cpes/component",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.scanoss.com/v2/vulnerabilities/cpes/component"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.scanoss.com/v2/vulnerabilities/cpes/component")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.scanoss.com/v2/vulnerabilities/cpes/component")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"component": {
"purl": "pkg:github/scanoss/engine@1.0.0",
"requirement": "1.0.0",
"version": "1.0.0",
"cpes": [
"cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*"
]
},
"status": {
"status": "SUCCESS",
"message": "CPEs Successfully retrieved"
}
}"<string>"{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Vulnerabilities
Get CPEs (Common Platform Enumeration) associated with a single software component.
Returns Common Platform Enumeration identifiers that match the specified component. CPEs are used to identify IT platforms in vulnerability databases and enable vulnerability scanning and assessment.
GET
/
v2
/
vulnerabilities
/
cpes
/
component
Get CPEs (Common Platform Enumeration) associated with a single software component.
curl --request GET \
--url http://api.scanoss.com/v2/vulnerabilities/cpes/componentimport requests
url = "http://api.scanoss.com/v2/vulnerabilities/cpes/component"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://api.scanoss.com/v2/vulnerabilities/cpes/component', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://api.scanoss.com/v2/vulnerabilities/cpes/component",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.scanoss.com/v2/vulnerabilities/cpes/component"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.scanoss.com/v2/vulnerabilities/cpes/component")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.scanoss.com/v2/vulnerabilities/cpes/component")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"component": {
"purl": "pkg:github/scanoss/engine@1.0.0",
"requirement": "1.0.0",
"version": "1.0.0",
"cpes": [
"cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*"
]
},
"status": {
"status": "SUCCESS",
"message": "CPEs Successfully retrieved"
}
}"<string>"{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Query Parameters
Package URL identifying the component to analyze.
Version constraint for component resolution when PURL lacks explicit version.
Response
A successful response.
Success example. For error cases, each component block reports the processing status via info_message and info_code. Example: {"component":{"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"}}