Home > widget-integration > InstantSearchAPI > getProductsByHandle
InstantSearchAPI.getProductsByHandle() method
Fetch products by handles.
**Legacy**: getProductsDetailByHandle(context, handle, searchQuery) **New**: getProductsByHandle(handles, options?) with typed response
Features migrated from legacy: - Single or multiple handles support - Product availability filtering - B2B support - POST method for larger payloads
Signature:
getProductsByHandle(handles: string[], options?: {
query?: string;
productAvailable?: boolean;
}): Promise<ProductItem[]>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
handles |
string[] |
Array of product handles |
|
options |
{ query?: string; productAvailable?: boolean; } |
(Optional) Optional request options |
Returns:
Promise<ProductItem[]>
Array of products