curl --request POST \
--url https://search.glood.ai/api/storefront/v1/headless/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"collection": "<string>",
"tree": 123,
"target_id": 123,
"locale": "en-US",
"market": 123,
"publication_ids": [
"30085840999"
],
"include_values": true,
"include_disabled": false,
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
'import requests
url = "https://search.glood.ai/api/storefront/v1/headless/filters"
payload = {
"collection": "<string>",
"tree": 123,
"target_id": 123,
"locale": "en-US",
"market": 123,
"publication_ids": ["30085840999"],
"include_values": True,
"include_disabled": False,
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
headers = {
"x-shop": "<x-shop>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-shop': '<x-shop>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
collection: '<string>',
tree: 123,
target_id: 123,
locale: 'en-US',
market: 123,
publication_ids: ['30085840999'],
include_values: true,
include_disabled: false,
visitor_id: '<string>',
client_id: '<string>',
customer_id: '<string>'
})
};
fetch('https://search.glood.ai/api/storefront/v1/headless/filters', 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://search.glood.ai/api/storefront/v1/headless/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection' => '<string>',
'tree' => 123,
'target_id' => 123,
'locale' => 'en-US',
'market' => 123,
'publication_ids' => [
'30085840999'
],
'include_values' => true,
'include_disabled' => false,
'visitor_id' => '<string>',
'client_id' => '<string>',
'customer_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop: <x-shop>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://search.glood.ai/api/storefront/v1/headless/filters"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-shop", "<x-shop>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://search.glood.ai/api/storefront/v1/headless/filters")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://search.glood.ai/api/storefront/v1/headless/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-shop"] = '<x-shop>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"facets": [
{
"id": 1,
"key": "color",
"title": "Color",
"type": "color",
"attribute_type": "option",
"position": 1,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": true, "show_count": true, "collapsible": true, "searchable": false, "show_more": true, "max_display": 10 },
"min": null, "max": null, "step": null, "unit": null, "suffix": null,
"values": [
{ "value": "red", "label": "Red", "count": null, "position": 1, "hex": "#ff0000", "image": null, "order": null }
]
},
{
"id": 2,
"key": "price",
"title": "Price",
"type": "number",
"attribute_type": "price",
"position": 2,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": false, "show_count": true, "collapsible": true, "searchable": false, "show_more": false, "max_display": 10 },
"min": 0, "max": 1000, "step": 1, "unit": "$", "suffix": "",
"values": []
}
],
"tree": { "id": 5, "target_page": "search", "target_ids": [10], "is_default": false, "title": "Search filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 2 }
}
{
"facets": [],
"tree": { "id": null, "target_page": "search", "target_ids": [], "is_default": true, "title": "Filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 0 }
}
{
"error": [
{
"message": "\"tree\" must be a number",
"path": ["tree"],
"type": "number.base",
"context": { "label": "tree", "key": "tree" }
}
],
"ok": false
}
Filters
DB-driven facet (filter) definitions for the resolved filter tree. No live counts (see filter-aggregations). Auth: Authorization: Bearer <gl_sf_...> + x-shop.
curl --request POST \
--url https://search.glood.ai/api/storefront/v1/headless/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"collection": "<string>",
"tree": 123,
"target_id": 123,
"locale": "en-US",
"market": 123,
"publication_ids": [
"30085840999"
],
"include_values": true,
"include_disabled": false,
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
'import requests
url = "https://search.glood.ai/api/storefront/v1/headless/filters"
payload = {
"collection": "<string>",
"tree": 123,
"target_id": 123,
"locale": "en-US",
"market": 123,
"publication_ids": ["30085840999"],
"include_values": True,
"include_disabled": False,
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
headers = {
"x-shop": "<x-shop>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-shop': '<x-shop>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
collection: '<string>',
tree: 123,
target_id: 123,
locale: 'en-US',
market: 123,
publication_ids: ['30085840999'],
include_values: true,
include_disabled: false,
visitor_id: '<string>',
client_id: '<string>',
customer_id: '<string>'
})
};
fetch('https://search.glood.ai/api/storefront/v1/headless/filters', 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://search.glood.ai/api/storefront/v1/headless/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection' => '<string>',
'tree' => 123,
'target_id' => 123,
'locale' => 'en-US',
'market' => 123,
'publication_ids' => [
'30085840999'
],
'include_values' => true,
'include_disabled' => false,
'visitor_id' => '<string>',
'client_id' => '<string>',
'customer_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop: <x-shop>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://search.glood.ai/api/storefront/v1/headless/filters"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-shop", "<x-shop>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://search.glood.ai/api/storefront/v1/headless/filters")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://search.glood.ai/api/storefront/v1/headless/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-shop"] = '<x-shop>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection\": \"<string>\",\n \"tree\": 123,\n \"target_id\": 123,\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"include_values\": true,\n \"include_disabled\": false,\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"facets": [
{
"id": 1,
"key": "color",
"title": "Color",
"type": "color",
"attribute_type": "option",
"position": 1,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": true, "show_count": true, "collapsible": true, "searchable": false, "show_more": true, "max_display": 10 },
"min": null, "max": null, "step": null, "unit": null, "suffix": null,
"values": [
{ "value": "red", "label": "Red", "count": null, "position": 1, "hex": "#ff0000", "image": null, "order": null }
]
},
{
"id": 2,
"key": "price",
"title": "Price",
"type": "number",
"attribute_type": "price",
"position": 2,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": false, "show_count": true, "collapsible": true, "searchable": false, "show_more": false, "max_display": 10 },
"min": 0, "max": 1000, "step": 1, "unit": "$", "suffix": "",
"values": []
}
],
"tree": { "id": 5, "target_page": "search", "target_ids": [10], "is_default": false, "title": "Search filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 2 }
}
{
"facets": [],
"tree": { "id": null, "target_page": "search", "target_ids": [], "is_default": true, "title": "Filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 0 }
}
{
"error": [
{
"message": "\"tree\" must be a number",
"path": ["tree"],
"type": "number.base",
"context": { "label": "tree", "key": "tree" }
}
],
"ok": false
}
{
"facets": [
{
"id": 1,
"key": "color",
"title": "Color",
"type": "color",
"attribute_type": "option",
"position": 1,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": true, "show_count": true, "collapsible": true, "searchable": false, "show_more": true, "max_display": 10 },
"min": null, "max": null, "step": null, "unit": null, "suffix": null,
"values": [
{ "value": "red", "label": "Red", "count": null, "position": 1, "hex": "#ff0000", "image": null, "order": null }
]
},
{
"id": 2,
"key": "price",
"title": "Price",
"type": "number",
"attribute_type": "price",
"position": 2,
"expanded": true,
"visible": true,
"operator": "or",
"settings": { "multi_select": false, "show_count": true, "collapsible": true, "searchable": false, "show_more": false, "max_display": 10 },
"min": 0, "max": 1000, "step": 1, "unit": "$", "suffix": "",
"values": []
}
],
"tree": { "id": 5, "target_page": "search", "target_ids": [10], "is_default": false, "title": "Search filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 2 }
}
{
"facets": [],
"tree": { "id": null, "target_page": "search", "target_ids": [], "is_default": true, "title": "Filters", "settings": {} },
"metadata": { "locale": "en-US", "market": null, "region": "toronto", "total_facets": 0 }
}
{
"error": [
{
"message": "\"tree\" must be a number",
"path": ["tree"],
"type": "number.base",
"context": { "label": "tree", "key": "tree" }
}
],
"ok": false
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Shopify store URL. Resolves the shop for the request (headless does not accept ?shop=).
"shop.myshopify.com"
Body
Request body
Filter definitions request (DB-driven, no live counts).
Collection id to resolve a collection-scoped tree. String or integer.
Explicit filter tree id (overrides target-page resolution).
Page whose tree to resolve.
search, collection Target object id (e.g. collection id).
BCP-47 locale.
Shopify market id.
Optional. Numeric Shopify publication (sales channel) ids. When present, only products published on at least one of these channels are returned and the default "published to the Online Store" gate is replaced by this filter; market and B2B filters still apply. A single id may be sent without the array wrapper. Each id must be one the merchant enabled under Settings → Sales channels; unknown ids return 400. The id is the numeric tail of gid://shopify/Publication/.
50^[0-9]+$["30085840999"]
Include each facet's selectable values.
Include disabled filters.
Anonymous device/browser UID (the gl_s_uid cookie). The primary personalization key; stays stable when a customer logs in.
Per-session / per-device identifier.
Shopify customer id. Present only when the shopper is logged in; enables customer-level personalization.
Response
Filter definitions
Was this page helpful?