Get Variant Facets
curl --request GET \
--url https://api.merchantops.ai/api/products/{product_key}/variants/facetsimport requests
url = "https://api.merchantops.ai/api/products/{product_key}/variants/facets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.merchantops.ai/api/products/{product_key}/variants/facets', 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.merchantops.ai/api/products/{product_key}/variants/facets",
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.merchantops.ai/api/products/{product_key}/variants/facets"
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.merchantops.ai/api/products/{product_key}/variants/facets")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/products/{product_key}/variants/facets")
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{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Variants
Get Variant Facets
Facets for the variants of a single product.
Shape: {properties: {<key>: {label, values: [{value, count}]}, ...}}.
A property is included when it is isFacetable=true,
level='variant', referenced by the parent product’s
ProductType.properties, and its distinct non-empty value count
across this product’s variants falls in [2, 50].
GET
/
api
/
products
/
{product_key}
/
variants
/
facets
Get Variant Facets
curl --request GET \
--url https://api.merchantops.ai/api/products/{product_key}/variants/facetsimport requests
url = "https://api.merchantops.ai/api/products/{product_key}/variants/facets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.merchantops.ai/api/products/{product_key}/variants/facets', 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.merchantops.ai/api/products/{product_key}/variants/facets",
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.merchantops.ai/api/products/{product_key}/variants/facets"
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.merchantops.ai/api/products/{product_key}/variants/facets")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/products/{product_key}/variants/facets")
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{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}