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.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });
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": {}
}Check the status of a product search retrieval job and get results when ready.
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.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });
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": {}
}Reference ID used for checking status
^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$"prs-ref_3fa85f64-5717-4562-b3fc"
Was this page helpful?