Home > widget-integration > InstantSearchAPI > getProductsById

InstantSearchAPI.getProductsById() method

Fetch products by IDs.

**Legacy**: getProductsDetail(context, ids) **New**: getProductsById(ids, options?) with typed response

Features migrated from legacy: - Product availability filtering - B2B support - Locale params

Signature:

getProductsById(ids: string[], options?: {
		productAvailable?: boolean;
	}): Promise<ProductItem[]>;

Parameters

Parameter

Type

Description

ids

string[]

Array of product IDs

options

{ productAvailable?: boolean; }

(Optional) Optional request options

Returns:

Promise<ProductItem[]>

Array of products