Get component-level Geo Provenance based on contributor declared location
This is the current method that accepts ComponentRequest for enhanced component identification
Replaces the deprecated GetComponentContributors method
curl --request GET \
--url https://api.example.com/v2/geoprovenance/countries/componentimport requests
url = "https://api.example.com/v2/geoprovenance/countries/component"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v2/geoprovenance/countries/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 => "https://api.example.com/v2/geoprovenance/countries/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 := "https://api.example.com/v2/geoprovenance/countries/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("https://api.example.com/v2/geoprovenance/countries/component")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/geoprovenance/countries/component")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"component_location": {
"purl": "pkg:github/scanoss/engine@5.0.0",
"declared_locations": [
{
"type": "owner",
"location": "Barcelona, Spain"
},
{
"type": "contributor",
"location": "Berlin, Germany"
}
],
"curated_locations": [
{
"country": "Spain",
"count": 8
},
{
"country": "Germany",
"count": 3
},
{
"country": "United States",
"count": 2
}
]
},
"status": {
"status": "SUCCESS",
"message": "Geo-provenance successfully retrieved"
}
}"<string>"{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}GeoProvenance
Get component-level Geo Provenance based on contributor declared location This is the current method that accepts ComponentRequest for enhanced component identification Replaces the deprecated GetComponentContributors method
GET
/
v2
/
geoprovenance
/
countries
/
component
Get component-level Geo Provenance based on contributor declared location
This is the current method that accepts ComponentRequest for enhanced component identification
Replaces the deprecated GetComponentContributors method
curl --request GET \
--url https://api.example.com/v2/geoprovenance/countries/componentimport requests
url = "https://api.example.com/v2/geoprovenance/countries/component"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v2/geoprovenance/countries/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 => "https://api.example.com/v2/geoprovenance/countries/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 := "https://api.example.com/v2/geoprovenance/countries/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("https://api.example.com/v2/geoprovenance/countries/component")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/geoprovenance/countries/component")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"component_location": {
"purl": "pkg:github/scanoss/engine@5.0.0",
"declared_locations": [
{
"type": "owner",
"location": "Barcelona, Spain"
},
{
"type": "contributor",
"location": "Berlin, Germany"
}
],
"curated_locations": [
{
"country": "Spain",
"count": 8
},
{
"country": "Germany",
"count": 3
},
{
"country": "United States",
"count": 2
}
]
},
"status": {
"status": "SUCCESS",
"message": "Geo-provenance 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.
Component level Provenance Response data (JSON payload) Contains geo-provenance information for components based on contributor declared locations. This is the current response format that replaces the deprecated ContributorResponse.