curl --request POST \
--url https://search.glood.ai/api/storefront/v1/headless/instant-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"query": "sho",
"locale": "en-US",
"market": 123,
"publication_ids": [
"30085840999"
],
"limit": 50,
"objects": [],
"view": "product_details",
"trending": {
"type": "searches",
"period": "7d",
"category": "<string>",
"limit": 20
},
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
'import requests
url = "https://search.glood.ai/api/storefront/v1/headless/instant-search"
payload = {
"query": "sho",
"locale": "en-US",
"market": 123,
"publication_ids": ["30085840999"],
"limit": 50,
"objects": [],
"view": "product_details",
"trending": {
"type": "searches",
"period": "7d",
"category": "<string>",
"limit": 20
},
"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({
query: 'sho',
locale: 'en-US',
market: 123,
publication_ids: ['30085840999'],
limit: 50,
objects: [],
view: 'product_details',
trending: {type: 'searches', period: '7d', category: '<string>', limit: 20},
visitor_id: '<string>',
client_id: '<string>',
customer_id: '<string>'
})
};
fetch('https://search.glood.ai/api/storefront/v1/headless/instant-search', 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/instant-search",
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([
'query' => 'sho',
'locale' => 'en-US',
'market' => 123,
'publication_ids' => [
'30085840999'
],
'limit' => 50,
'objects' => [
],
'view' => 'product_details',
'trending' => [
'type' => 'searches',
'period' => '7d',
'category' => '<string>',
'limit' => 20
],
'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/instant-search"
payload := strings.NewReader("{\n \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\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/instant-search")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\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/instant-search")
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 \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"query": "sho",
"corrected_query": "shoe",
"autocorrect": {
"original_query": "sho",
"corrected_query": "shoe",
"confidence": 0.92,
"corrections": [],
"alternatives": []
},
"suggestions": [
{ "text": "shoes", "type": "keyword", "object_count": 120, "search_count": 45 }
],
"products": {
"results": [
{
"product_id": 9311227838783,
"title": "Running Shoe",
"handle": "running-shoe",
"product_type": "Shoes",
"vendor": "Acme",
"tags": ["sale", "summer"],
"price": 49.99,
"compare_at_price": 69.99,
"display_price": 49.99,
"display_compare_at_price": 69.99,
"display_currency": "USD",
"original_currency": "USD",
"currency_rate": 1,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 42,
"trending_rank": 3,
"sales_rank": 7,
"image": { "id": "gid://shopify/ProductImage/1", "url": "https://cdn.shopify.com/s/files/1/shoe.jpg", "width": 800, "height": 800, "alt_text": "Running Shoe" },
"featured_media": null,
"media": [],
"options": [ { "id": 111, "name": "Size", "position": 1, "values": ["S", "M", "L"] } ],
"variants": [
{
"variant_id": 456,
"title": "M",
"display_name": "Running Shoe - M",
"sku": "RS-M",
"position": 1,
"price": 49.99,
"compare_at_price": 69.99,
"available_for_sale": true,
"is_in_stock": true,
"sellable_online_quantity": 10,
"selected_options": [ { "name": "Size", "value": "M" } ],
"image": null
}
],
"metafields": [ { "namespace": "custom", "key": "material", "value": "leather" } ]
}
],
"total": 120
},
"collections": { "results": [ { "collection_id": 1, "title": "Shoes", "handle": "shoes", "image": null } ], "total": 3 },
"pages": { "results": [ { "page_id": 1, "title": "Size Guide", "handle": "size-guide" } ], "total": 1 },
"articles": { "results": [], "total": 0 },
"trending": { "searches": [], "products": [] },
"metadata": { "query_time": 12, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"query": "",
"corrected_query": null,
"autocorrect": null,
"suggestions": [],
"products": { "results": [], "total": 0 },
"collections": { "results": [], "total": 0 },
"pages": { "results": [], "total": 0 },
"articles": { "results": [], "total": 0 },
"trending": {
"searches": [ { "term": "sale", "translated_term": "sale", "search_count": 300 } ],
"products": []
},
"metadata": { "query_time": 8, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"error": [
{
"message": "\"limit\" must be less than or equal to 100",
"path": ["limit"],
"type": "number.max",
"context": { "limit": 100, "value": 500, "label": "limit", "key": "limit" }
}
],
"ok": false
}
Instant Search
Type-ahead search in a single call: products / collections / pages / articles + keyword suggestions + autocorrect, plus an empty-state trending block. Auth: Authorization: Bearer <gl_sf_...> + x-shop.
curl --request POST \
--url https://search.glood.ai/api/storefront/v1/headless/instant-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"query": "sho",
"locale": "en-US",
"market": 123,
"publication_ids": [
"30085840999"
],
"limit": 50,
"objects": [],
"view": "product_details",
"trending": {
"type": "searches",
"period": "7d",
"category": "<string>",
"limit": 20
},
"visitor_id": "<string>",
"client_id": "<string>",
"customer_id": "<string>"
}
'import requests
url = "https://search.glood.ai/api/storefront/v1/headless/instant-search"
payload = {
"query": "sho",
"locale": "en-US",
"market": 123,
"publication_ids": ["30085840999"],
"limit": 50,
"objects": [],
"view": "product_details",
"trending": {
"type": "searches",
"period": "7d",
"category": "<string>",
"limit": 20
},
"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({
query: 'sho',
locale: 'en-US',
market: 123,
publication_ids: ['30085840999'],
limit: 50,
objects: [],
view: 'product_details',
trending: {type: 'searches', period: '7d', category: '<string>', limit: 20},
visitor_id: '<string>',
client_id: '<string>',
customer_id: '<string>'
})
};
fetch('https://search.glood.ai/api/storefront/v1/headless/instant-search', 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/instant-search",
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([
'query' => 'sho',
'locale' => 'en-US',
'market' => 123,
'publication_ids' => [
'30085840999'
],
'limit' => 50,
'objects' => [
],
'view' => 'product_details',
'trending' => [
'type' => 'searches',
'period' => '7d',
'category' => '<string>',
'limit' => 20
],
'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/instant-search"
payload := strings.NewReader("{\n \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\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/instant-search")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\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/instant-search")
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 \"query\": \"sho\",\n \"locale\": \"en-US\",\n \"market\": 123,\n \"publication_ids\": [\n \"30085840999\"\n ],\n \"limit\": 50,\n \"objects\": [],\n \"view\": \"product_details\",\n \"trending\": {\n \"type\": \"searches\",\n \"period\": \"7d\",\n \"category\": \"<string>\",\n \"limit\": 20\n },\n \"visitor_id\": \"<string>\",\n \"client_id\": \"<string>\",\n \"customer_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"query": "sho",
"corrected_query": "shoe",
"autocorrect": {
"original_query": "sho",
"corrected_query": "shoe",
"confidence": 0.92,
"corrections": [],
"alternatives": []
},
"suggestions": [
{ "text": "shoes", "type": "keyword", "object_count": 120, "search_count": 45 }
],
"products": {
"results": [
{
"product_id": 9311227838783,
"title": "Running Shoe",
"handle": "running-shoe",
"product_type": "Shoes",
"vendor": "Acme",
"tags": ["sale", "summer"],
"price": 49.99,
"compare_at_price": 69.99,
"display_price": 49.99,
"display_compare_at_price": 69.99,
"display_currency": "USD",
"original_currency": "USD",
"currency_rate": 1,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 42,
"trending_rank": 3,
"sales_rank": 7,
"image": { "id": "gid://shopify/ProductImage/1", "url": "https://cdn.shopify.com/s/files/1/shoe.jpg", "width": 800, "height": 800, "alt_text": "Running Shoe" },
"featured_media": null,
"media": [],
"options": [ { "id": 111, "name": "Size", "position": 1, "values": ["S", "M", "L"] } ],
"variants": [
{
"variant_id": 456,
"title": "M",
"display_name": "Running Shoe - M",
"sku": "RS-M",
"position": 1,
"price": 49.99,
"compare_at_price": 69.99,
"available_for_sale": true,
"is_in_stock": true,
"sellable_online_quantity": 10,
"selected_options": [ { "name": "Size", "value": "M" } ],
"image": null
}
],
"metafields": [ { "namespace": "custom", "key": "material", "value": "leather" } ]
}
],
"total": 120
},
"collections": { "results": [ { "collection_id": 1, "title": "Shoes", "handle": "shoes", "image": null } ], "total": 3 },
"pages": { "results": [ { "page_id": 1, "title": "Size Guide", "handle": "size-guide" } ], "total": 1 },
"articles": { "results": [], "total": 0 },
"trending": { "searches": [], "products": [] },
"metadata": { "query_time": 12, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"query": "",
"corrected_query": null,
"autocorrect": null,
"suggestions": [],
"products": { "results": [], "total": 0 },
"collections": { "results": [], "total": 0 },
"pages": { "results": [], "total": 0 },
"articles": { "results": [], "total": 0 },
"trending": {
"searches": [ { "term": "sale", "translated_term": "sale", "search_count": 300 } ],
"products": []
},
"metadata": { "query_time": 8, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"error": [
{
"message": "\"limit\" must be less than or equal to 100",
"path": ["limit"],
"type": "number.max",
"context": { "limit": 100, "value": 500, "label": "limit", "key": "limit" }
}
],
"ok": false
}
{
"query": "sho",
"corrected_query": "shoe",
"autocorrect": {
"original_query": "sho",
"corrected_query": "shoe",
"confidence": 0.92,
"corrections": [],
"alternatives": []
},
"suggestions": [
{ "text": "shoes", "type": "keyword", "object_count": 120, "search_count": 45 }
],
"products": {
"results": [
{
"product_id": 9311227838783,
"title": "Running Shoe",
"handle": "running-shoe",
"product_type": "Shoes",
"vendor": "Acme",
"tags": ["sale", "summer"],
"price": 49.99,
"compare_at_price": 69.99,
"display_price": 49.99,
"display_compare_at_price": 69.99,
"display_currency": "USD",
"original_currency": "USD",
"currency_rate": 1,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 42,
"trending_rank": 3,
"sales_rank": 7,
"image": { "id": "gid://shopify/ProductImage/1", "url": "https://cdn.shopify.com/s/files/1/shoe.jpg", "width": 800, "height": 800, "alt_text": "Running Shoe" },
"featured_media": null,
"media": [],
"options": [ { "id": 111, "name": "Size", "position": 1, "values": ["S", "M", "L"] } ],
"variants": [
{
"variant_id": 456,
"title": "M",
"display_name": "Running Shoe - M",
"sku": "RS-M",
"position": 1,
"price": 49.99,
"compare_at_price": 69.99,
"available_for_sale": true,
"is_in_stock": true,
"sellable_online_quantity": 10,
"selected_options": [ { "name": "Size", "value": "M" } ],
"image": null
}
],
"metafields": [ { "namespace": "custom", "key": "material", "value": "leather" } ]
}
],
"total": 120
},
"collections": { "results": [ { "collection_id": 1, "title": "Shoes", "handle": "shoes", "image": null } ], "total": 3 },
"pages": { "results": [ { "page_id": 1, "title": "Size Guide", "handle": "size-guide" } ], "total": 1 },
"articles": { "results": [], "total": 0 },
"trending": { "searches": [], "products": [] },
"metadata": { "query_time": 12, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"query": "",
"corrected_query": null,
"autocorrect": null,
"suggestions": [],
"products": { "results": [], "total": 0 },
"collections": { "results": [], "total": 0 },
"pages": { "results": [], "total": 0 },
"articles": { "results": [], "total": 0 },
"trending": {
"searches": [ { "term": "sale", "translated_term": "sale", "search_count": 300 } ],
"products": []
},
"metadata": { "query_time": 8, "locale": "en-US", "market": null, "min_query_length": 2 }
}
{
"error": [
{
"message": "\"limit\" must be less than or equal to 100",
"path": ["limit"],
"type": "number.max",
"context": { "limit": 100, "value": 500, "label": "limit", "key": "limit" }
}
],
"ok": false
}
publication_ids is sent, the empty-query trending products are ordered by trending within those sales channels.Authorizations
Headers
Body
Request body
Instant search request. Union of the legacy instant-results, instant-suggest and trending inputs.
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"]
Response
Instant search results
Instant search results: products / collections / pages / articles + suggestions + autocorrect + trending.
Was this page helpful?