Overview
Use product discovery to power search bars, product detail pages, and catalog browsers across any merchant on the internet. Bothproducts.search and products.details are async jobs - they return a refId, and results arrive once the background work completes. See Polling or Webhooks for how to handle the async pattern.
Prerequisites
Search the catalog
Kick off a product search
Call
products.search with a text query and optional filters. Returns immediately with a refId.Poll for results
Use
products.pollSearch to check status until it’s "complete" or "failed". See Polling for the reusable helper and strategies.Fetch product details
If you need more granular product information, such as available options and pricing, callproducts.details with the link from search for the full enriched payload.
Poll for results
Use
products.pollDetails to check status. See Polling for the reusable helper.Image search
Search by image instead of text. Pass a URL, data URL, or base64 payload to find visually similar products.Sync mode
All async operations supportmode: "sync", which waits up to 30 seconds for the operation to complete before returning. This can simplify your code for quick lookups by avoiding polling entirely.
If the operation takes longer than 30 seconds, sync mode returns with a non-terminal status and you’ll need to poll normally. For operations that may take longer (e.g. large searches), use
mode: "async" with Polling.Merchant search
Usetype: 'merchant' to search within a specific merchant’s catalog. Pass the merchant name, host, or any URL from that merchant.
Merchant search accepts a case-insensitive name (e.g.
"Nike"), a host (e.g. "nike.com"), or any URL from the merchant. When query is omitted, the merchant’s catalog browse is returned.Search parameters reference
Top-level parameters
| Parameter | Type | Description |
|---|---|---|
type | "global" | "merchant" | Required. "global" for cross-merchant search, "merchant" for single-merchant |
filters | object | Required. Search filters (see below) |
query | string | Optional text query (merchant search only) |
limit | number | Results per page - 1 to 100, default 20 |
cursor | integer | Pagination cursor from a previous response |
mode | "async" | "sync" | "async" (default) returns immediately; "sync" waits up to 30s |
Global search filters (type: 'global')
| Parameter | Type | Description |
|---|---|---|
filters.type | "text" | "image" | Required. Text query or image-based search |
filters.query | string | Required for text. Full-text search term |
filters.imageUrl | string | Required for image. HTTP URL, data URL, or base64 payload |
filters.country | string | ISO country code (e.g. "US", "JP") |
filters.price.min | number | Minimum price filter (text search only) |
filters.price.max | number | Maximum price filter (text search only) |
filters.price.currency | string | Currency for price filter (e.g. "USD") |
filters.sortBy | "price-low-to-high" | "price-high-to-low" | Sort by price (text search only) |
Merchant search filters (type: 'merchant')
| Parameter | Type | Description |
|---|---|---|
filters.merchant | string | Required. Merchant name, host, or URL (e.g. "nike.com") |
filters.price.min | number | Minimum price filter |
filters.price.max | number | Maximum price filter |
filters.price.currency | string | Currency for price filter |
Error handling
| Error | Cause | Resolution |
|---|---|---|
401 Unauthorized | Invalid API key | Check HENRY_SDK_API_KEY |
400 Bad Request | Missing query or invalid filter values | Validate input before calling |
status: "failed" | Job error - check error field | Log and retry |
Next steps
Universal Cart
Use the product
link to add items to a cartMerchants
Browse supported merchants beforehand