curl --request GET \
--url https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version} \
--header 'Authorization: Bearer <token>'import requests
url = "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}', 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 => "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"spdxVersion": "SPDX-2.2",
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"name": "numpy-1.21.2-py39hd8d4704_0.conda",
"documentNamespace": "https://repo.anaconda.com/spdx/main/linux-64/numpy-1.21.2-py39hd8d4704_0.conda",
"creationInfo": {
"creators": [
"Organization: Anaconda, Inc."
],
"created": "2024-05-07T20:09:26Z"
},
"packages": [
"..."
],
"files": [
"..."
],
"relationships": [
"..."
]
}{
"status": 400,
"code": "bad-request",
"message": "Invalid channel name. Only 'main' and 'main-x' are supported."
}{
"status": 401,
"code": "unauthorized",
"message": "Authentication required."
}{
"status": 403,
"code": "forbidden",
"message": "User does not have an active premium subscription!"
}{
"status": 404,
"code": "artifact-not-found",
"message": "Artifact not found in main with properties name = numpy, platform = linux-64, version = 1.21.3"
}Get SBOM by Package Properties
Returns the SBOM that Anaconda has on file for the package identified by its channel, artifact family, name, platform, and version.
curl --request GET \
--url https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version} \
--header 'Authorization: Bearer <token>'import requests
url = "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}', 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 => "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://repo.anaconda.cloud/repo/{channel_name}/sboms/by-properties/{artifact_family}/{common_name}/{platform}/{version}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"spdxVersion": "SPDX-2.2",
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"name": "numpy-1.21.2-py39hd8d4704_0.conda",
"documentNamespace": "https://repo.anaconda.com/spdx/main/linux-64/numpy-1.21.2-py39hd8d4704_0.conda",
"creationInfo": {
"creators": [
"Organization: Anaconda, Inc."
],
"created": "2024-05-07T20:09:26Z"
},
"packages": [
"..."
],
"files": [
"..."
],
"relationships": [
"..."
]
}{
"status": 400,
"code": "bad-request",
"message": "Invalid channel name. Only 'main' and 'main-x' are supported."
}{
"status": 401,
"code": "unauthorized",
"message": "Authentication required."
}{
"status": 403,
"code": "forbidden",
"message": "User does not have an active premium subscription!"
}{
"status": 404,
"code": "artifact-not-found",
"message": "Artifact not found in main with properties name = numpy, platform = linux-64, version = 1.21.3"
}artifact_family = conda) which includes .conda and .tar.bz2 artifacts, and is only enabled on the main and main-x channels..tar.bz2 and .conda versions of the package are treated as the same package for SBOM purposes if all other properties (including build) are identical.A channel can contain multiple builds of the same package version. For example, a package might have separate builds for different Python versions. When the provided properties match more than one package, the API returns a
404 response asking you to narrow your query. Add the build query parameter with the package’s build string to resolve the ambiguity.You can find the build string in the package’s filename. For example, the build string of numpy-1.21.2-py39hd8d4704_0.tar.bz2 is py39hd8d4704_0.404. In these cases, try using the Get SBOM by SHA256 endpoint instead.Authorizations
Bearer token authentication with your Anaconda API key. Create a key in your account settings or with the anaconda auth api-key command.
See the Getting started page for the full authentication flow.
Path Parameters
The channel that contains the package. The SBOM API serves the main and main-x channels only.
main, main-x The package's artifact family. For conda packages, this is conda.
conda The package's name, for example numpy or _py-xgboost-mutex.
The package's platform subdirectory, for example linux-64, win-64, or noarch.
The package's version, for example 1.21.2.
Query Parameters
The package's build string, for example py39hd8d4704_0. The build string is part of the package's filename. For example, the build string of numpy-1.21.2-py39hd8d4704_0.tar.bz2 is py39hd8d4704_0.
Required when the package's other properties match more than one package.
Use view to receive the SBOM as JSON in the response body. Use download to receive the SBOM as a byte stream with a Content-Disposition header that provides the SBOM's filename.
view, download Response
The package's SBOM. The response is JSON in view mode and a byte stream in download mode.
An SPDX 2.2.1 JSON document.
Was this page helpful?