Search / Autocomplete Categories
curl --request GET \
--url https://{base-address}/discovery/search/categories \
--header 'x-environment-id: <x-environment-id>' \
--header 'x-tenant-id: <x-tenant-id>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://{base-address}/discovery/search/categories"
headers = {
"x-tenant-id": "<x-tenant-id>",
"x-workspace-id": "<x-workspace-id>",
"x-environment-id": "<x-environment-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-tenant-id': '<x-tenant-id>',
'x-workspace-id': '<x-workspace-id>',
'x-environment-id': '<x-environment-id>'
}
};
fetch('https://{base-address}/discovery/search/categories', 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://{base-address}/discovery/search/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-environment-id: <x-environment-id>",
"x-tenant-id: <x-tenant-id>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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://{base-address}/discovery/search/categories"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-environment-id", "<x-environment-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{base-address}/discovery/search/categories")
.header("x-tenant-id", "<x-tenant-id>")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-environment-id", "<x-environment-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base-address}/discovery/search/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["x-workspace-id"] = '<x-workspace-id>'
request["x-environment-id"] = '<x-environment-id>'
response = http.request(request)
puts response.read_body{
"categories": [
{
"id": "<string>",
"name": "<string>",
"provider_id": "<string>",
"url": "<string>"
}
],
"total_count": 123
}{
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}{
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}Auto Complete
Categories
Returns catalog categories matching a text query, typically used to power a category autocomplete or typeahead UI.
Categories configured as autocomplete exclusions in the catalog’s search settings are automatically excluded.
GET
/
discovery
/
search
/
categories
Search / Autocomplete Categories
curl --request GET \
--url https://{base-address}/discovery/search/categories \
--header 'x-environment-id: <x-environment-id>' \
--header 'x-tenant-id: <x-tenant-id>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://{base-address}/discovery/search/categories"
headers = {
"x-tenant-id": "<x-tenant-id>",
"x-workspace-id": "<x-workspace-id>",
"x-environment-id": "<x-environment-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-tenant-id': '<x-tenant-id>',
'x-workspace-id': '<x-workspace-id>',
'x-environment-id': '<x-environment-id>'
}
};
fetch('https://{base-address}/discovery/search/categories', 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://{base-address}/discovery/search/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-environment-id: <x-environment-id>",
"x-tenant-id: <x-tenant-id>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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://{base-address}/discovery/search/categories"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-environment-id", "<x-environment-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{base-address}/discovery/search/categories")
.header("x-tenant-id", "<x-tenant-id>")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-environment-id", "<x-environment-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base-address}/discovery/search/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["x-workspace-id"] = '<x-workspace-id>'
request["x-environment-id"] = '<x-environment-id>'
response = http.request(request)
puts response.read_body{
"categories": [
{
"id": "<string>",
"name": "<string>",
"provider_id": "<string>",
"url": "<string>"
}
],
"total_count": 123
}{
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}{
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}Before calling this endpoint, make sure you’ve generated an API token and picked the correct domain. See Authentication & Base URLs.
Use this to power a category typeahead. For term suggestions, use Auto-Suggestions; for the product search itself, use Search Products.
Headers
Identifies your organization. Ensures data isolation per tenant.
Identifies the workspace within your organization. Scopes resources to a specific workspace.
Identifies the environment you are targeting. Scopes the call to a specific deployment environment.
Query Parameters
Catalog to search categories within.
Text query to match categories against.
Locale for the category names.
Maximum number of categories to return.
Number of categories to skip.