Based on the specified PURL, this endpoint will return a list of vulnerabilities that are related to the package.
You can find a list of supported package managers here
Package URL Scheme
curl --request GET \
--url https://api.vulncheck.com/v3/purl?purl=pkg:hex/coherence@0.1.2 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer insert_token_here'
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/vulncheck-oss/sdk-go"
)
func main() {
client := sdk.Connect("https://api.vulncheck.com", "insert_token_here")
response, err := client.GetPurl("pkg:hex/coherence@0.1.2")
if err != nil {
panic(err)
}
prettyJSON, err := json.MarshalIndent(response.Data, "", " ")
if err != nil {
log.Fatalf("Failed to generate JSON: %v", err)
return
}
fmt.Println(string(prettyJSON))
}
import vulncheck_sdk
configuration = vulncheck_sdk.Configuration(host="https://api.vulncheck.com/v3")
configuration.api_key["Bearer"] = "insert_token_here"
with vulncheck_sdk.ApiClient(configuration) as api_client:
endpoints_client = vulncheck_sdk.EndpointsApi(api_client)
api_response = endpoints_client.purl_get("pkg:hex/coherence@0.1.2")
print(api_response.data)
vulncheck purl pkg:hex/coherence@0.1.2
{
"_benchmark": 0.057389,
"_meta": {
"purl_struct": {
"type": "hex",
"namespace": "",
"name": "coherence",
"version": "0.1.2",
"qualifiers": null,
"subpath": ""
},
"timestamp": "2023-09-11T15:02:50.325502302Z",
"total_documents": 1
},
"data": {
"cves": [
"CVE-2018-20301"
],
"vulnerabilities": [
{
"detection": "CVE-2018-20301",
"fixed_version": "0.5.2"
}
]
}
}