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β¦
