cURL
curl --request POST \
--url https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"product_ids": [
123
],
"recommendation_type": "similar_products",
"filter": {
"variants": {
"options": [
{
"name": "<string>",
"value": "<string>"
}
],
"is_in_stock": true,
"sku": [
"<string>"
],
"available_for_sale": true
},
"tags": [
"<string>"
],
"vendors": [
"<string>"
],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
},
"pagination": {
"cursor": "<string>",
"limit": 25
}
}
'import requests
url = "https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic"
payload = {
"product_ids": [123],
"recommendation_type": "similar_products",
"filter": {
"variants": {
"options": [
{
"name": "<string>",
"value": "<string>"
}
],
"is_in_stock": True,
"sku": ["<string>"],
"available_for_sale": True
},
"tags": ["<string>"],
"vendors": ["<string>"],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
},
"pagination": {
"cursor": "<string>",
"limit": 25
}
}
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({
product_ids: [123],
recommendation_type: 'similar_products',
filter: {
variants: {
options: [{name: '<string>', value: '<string>'}],
is_in_stock: true,
sku: ['<string>'],
available_for_sale: true
},
tags: ['<string>'],
vendors: ['<string>'],
metafields: [{namespace: '<string>', key: '<string>', value: '<string>'}]
},
pagination: {cursor: '<string>', limit: 25}
})
};
fetch('https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic', 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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic",
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([
'product_ids' => [
123
],
'recommendation_type' => 'similar_products',
'filter' => [
'variants' => [
'options' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'is_in_stock' => true,
'sku' => [
'<string>'
],
'available_for_sale' => true
],
'tags' => [
'<string>'
],
'vendors' => [
'<string>'
],
'metafields' => [
[
'namespace' => '<string>',
'key' => '<string>',
'value' => '<string>'
]
]
],
'pagination' => [
'cursor' => '<string>',
'limit' => 25
]
]),
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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic"
payload := strings.NewReader("{\n \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic")
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 \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"serve_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pagination": {
"cursor": null
},
"products": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"tags": "cotton,casual,bestseller",
"product_type": "T-Shirts",
"vendor": "BrandName",
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"options": [
{
"id": 123,
"name": "Title",
"position": 1,
"values": ["Default Title"]
}
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [
{
"name": "Title",
"value": "Default Title"
}
]
}
],
"metafields": []
}
]
}
{
"errors": [
{
"message": "\"product_ids\" is required",
"path": ["product_ids"],
"type": "any.required",
"context": {
"label": "product_ids",
"key": "product_ids"
}
}
]
}
Headless APIs
Get Automatic Recommendations
Get automatic recommendations powered using LLMs
POST
/
api
/
storefront
/
v3
/
headless
/
recommendations
/
automatic
cURL
curl --request POST \
--url https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"product_ids": [
123
],
"recommendation_type": "similar_products",
"filter": {
"variants": {
"options": [
{
"name": "<string>",
"value": "<string>"
}
],
"is_in_stock": true,
"sku": [
"<string>"
],
"available_for_sale": true
},
"tags": [
"<string>"
],
"vendors": [
"<string>"
],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
},
"pagination": {
"cursor": "<string>",
"limit": 25
}
}
'import requests
url = "https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic"
payload = {
"product_ids": [123],
"recommendation_type": "similar_products",
"filter": {
"variants": {
"options": [
{
"name": "<string>",
"value": "<string>"
}
],
"is_in_stock": True,
"sku": ["<string>"],
"available_for_sale": True
},
"tags": ["<string>"],
"vendors": ["<string>"],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
},
"pagination": {
"cursor": "<string>",
"limit": 25
}
}
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({
product_ids: [123],
recommendation_type: 'similar_products',
filter: {
variants: {
options: [{name: '<string>', value: '<string>'}],
is_in_stock: true,
sku: ['<string>'],
available_for_sale: true
},
tags: ['<string>'],
vendors: ['<string>'],
metafields: [{namespace: '<string>', key: '<string>', value: '<string>'}]
},
pagination: {cursor: '<string>', limit: 25}
})
};
fetch('https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic', 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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic",
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([
'product_ids' => [
123
],
'recommendation_type' => 'similar_products',
'filter' => [
'variants' => [
'options' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'is_in_stock' => true,
'sku' => [
'<string>'
],
'available_for_sale' => true
],
'tags' => [
'<string>'
],
'vendors' => [
'<string>'
],
'metafields' => [
[
'namespace' => '<string>',
'key' => '<string>',
'value' => '<string>'
]
]
],
'pagination' => [
'cursor' => '<string>',
'limit' => 25
]
]),
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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic"
payload := strings.NewReader("{\n \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\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://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://storefront.glood.ai/api/storefront/v3/headless/recommendations/automatic")
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 \"product_ids\": [\n 123\n ],\n \"recommendation_type\": \"similar_products\",\n \"filter\": {\n \"variants\": {\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"is_in_stock\": true,\n \"sku\": [\n \"<string>\"\n ],\n \"available_for_sale\": true\n },\n \"tags\": [\n \"<string>\"\n ],\n \"vendors\": [\n \"<string>\"\n ],\n \"metafields\": [\n {\n \"namespace\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"limit\": 25\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"serve_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pagination": {
"cursor": null
},
"products": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"tags": "cotton,casual,bestseller",
"product_type": "T-Shirts",
"vendor": "BrandName",
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"options": [
{
"id": 123,
"name": "Title",
"position": 1,
"values": ["Default Title"]
}
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [
{
"name": "Title",
"value": "Default Title"
}
]
}
],
"metafields": []
}
]
}
{
"errors": [
{
"message": "\"product_ids\" is required",
"path": ["product_ids"],
"type": "any.required",
"context": {
"label": "product_ids",
"key": "product_ids"
}
}
]
}
{
"status": "ok",
"serve_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pagination": {
"cursor": null
},
"products": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"tags": "cotton,casual,bestseller",
"product_type": "T-Shirts",
"vendor": "BrandName",
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"options": [
{
"id": 123,
"name": "Title",
"position": 1,
"values": ["Default Title"]
}
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [
{
"name": "Title",
"value": "Default Title"
}
]
}
],
"metafields": []
}
]
}
{
"errors": [
{
"message": "\"product_ids\" is required",
"path": ["product_ids"],
"type": "any.required",
"context": {
"label": "product_ids",
"key": "product_ids"
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Shopify store URL
Example:
"shop.myshopify.com"
Body
application/json
Request body
List of product IDs to get recommendations for
Type of recommendations to retrieve
Available options:
similar_products Context where recommendations will be displayed
Available options:
product_details, product_ids Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I