import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const response = await client.products.search({
filters: {
type: 'text',
query: 'Air Max Shoes',
country: 'US',
price: {
min: 1,
max: 100,
currency: 'USD',
},
sortBy: 'price-low-to-high',
},
type: 'global',
limit: 40,
mode: 'async',
});
console.log(response.refId);{
"refId": "<string>",
"status": "pending",
"result": {
"products": [
{
"link": "<string>",
"merchant": "<string>",
"host": "<string>",
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"images": [
{
"url": "<string>",
"isFeatured": true
}
],
"price": {
"value": 123,
"currency": "USD"
},
"originalPrice": {
"value": 123,
"currency": "USD"
},
"availability": "in_stock",
"options": {
"status": "<string>",
"values": [
{
"value": "<string>",
"label": "<string>",
"availability": "in_stock",
"images": [
{
"url": "<string>",
"isFeatured": true
}
],
"link": "<string>",
"nextOption": "<unknown>"
}
],
"label": "<string>"
}
}
],
"pagination": {
"nextCursor": 123,
"previousCursor": 123
}
},
"error": {}
}Search for products by text query or image input. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.
import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const response = await client.products.search({
filters: {
type: 'text',
query: 'Air Max Shoes',
country: 'US',
price: {
min: 1,
max: 100,
currency: 'USD',
},
sortBy: 'price-low-to-high',
},
type: 'global',
limit: 40,
mode: 'async',
});
console.log(response.refId);{
"refId": "<string>",
"status": "pending",
"result": {
"products": [
{
"link": "<string>",
"merchant": "<string>",
"host": "<string>",
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"images": [
{
"url": "<string>",
"isFeatured": true
}
],
"price": {
"value": 123,
"currency": "USD"
},
"originalPrice": {
"value": 123,
"currency": "USD"
},
"availability": "in_stock",
"options": {
"status": "<string>",
"values": [
{
"value": "<string>",
"label": "<string>",
"availability": "in_stock",
"images": [
{
"url": "<string>",
"isFeatured": true
}
],
"link": "<string>",
"nextOption": "<unknown>"
}
],
"label": "<string>"
}
}
],
"pagination": {
"nextCursor": 123,
"previousCursor": 123
}
},
"error": {}
}"global"Show child attributes
async, sync Limit the number of results
1 <= x <= 10020
Cursor returned from the previous response
0 <= x <= 90071992547409910
Product search queued successfully, use refId to check status and retrieve results
Was this page helpful?