Skip to main content
POST
/
product
/
search
JavaScript
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": {}
}

Authorizations

x-api-key
string
header
required

Body

application/json
type
string
required
Allowed value: "global"
filters
object
required
mode
enum<string>
default:async
Available options:
async,
sync
limit
number
default:20

Limit the number of results

Required range: 1 <= x <= 100
Example:

20

cursor
integer

Cursor returned from the previous response

Required range: 0 <= x <= 9007199254740991
Example:

0

Response

Product search queued successfully, use refId to check status and retrieve results

refId
string
required
Pattern: ^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$
status
enum<string>
required
Available options:
pending,
processing,
complete,
failed
result
object
error
object