Search products

In this example, we demonstrate how to quickly search for products by title using the OneEntry API.

βœ… Purpose of the scenario:
  • Connect to the OneEntry API
  • Search products by title text
  • Review the search results
βœ… What you need:
  • A valid PROJECT_URL and APP_TOKEN for authentication with the OneEntry API.
  • Products with titles configured in OneEntry.
πŸ“Œ Important:
  • searchProduct returns a plain array, not `{ items, total }`.
  • With traficLimit: true the SDK returns short cards (IProductSearchResult[] β€” only id, title, pageId) instead of full IProductsEntity[] β€” narrow by checking `'attributeValues' in found[0]`.
  • Search is based on the title field of localizeInfos with language consideration.
  • These examples do not include error handling.
  • You can manage errors using a try-catch block or by employing a construction like await Promise.catch((error) => error).
πŸ“š See in documentation:
πŸ“¦ SDK reference:
Loading sandbox…