Search products

post
/discoveries/search
[url](../../docs/quickstart/authentication.md)
[filter key](../../docs/enum/filter_key.md)
[semantic search scenario](../../docs/scenarios/search/semantic_search.md)
[visual search scenario](../../docs/scenarios/search/visual_search.md)
Content-Type
string
required

Content-Type

Allowed value:
application/json
Default:
application/json
as-store-id
string
required

The identifier of your Commerce store

Example:
f58a7bc4fb6d4719901906abde0c6f46
session_id
string

Session unique identifier. It is recommended to use this package to generate UUID.

Example:
47be3249-c1f4-446d-b652-8749be6ed577
query
string

The search query. This parameter is required for the semantic search scenario.

Example:
dress
image_url
string

URL of the image. This parameter is required for the visual search scenario. Note: Either image_url or image_base64 must be provided, but not both.

Example:
https://websites.am-static.com/assets/brands/logo/aftership.svg
image_base64
string

Base64-encoded image data. This parameter is required for the visual search scenario. Note: Either image_url or image_base64 must be provided, but not both.

Example:
/9j/4AAQSkZJRgABAQ...
include_filters
array[string]

Include products that correspond to the specified attribute. For the supported filter key, please refer to the filter key, and for the format of the filter, please refer to the following examples:

  • Conjunctive filtering: ["tags:Sale", "price:[48,56)"] means tags contain any of ('Sale') and price greater than or equal to 48 and less than 56
  • Disjunctive filtering: ["tags:Sofa,Couch,Bed"] means tags contain any of ('Sofa', 'Couch', 'Bed')
exclude_filters
array[string]

Exclude products that correspond to the specified attribute. For the supported filter key, please refer to the filter key, and for the format of the filter, please refer to the following examples:

  • Conjunctive filtering: ["!tags:Sale", "!categories:Furniture"] means tags not contain any of ('Sale') and categories not contain any of ('Furniture')
  • Disjunctive filtering: ["!tags:Sofa,Couch,Bed"] means tags not contain any of ('Sofa', 'Couch', 'Bed')
faceting
array[string]

To apply multiple filters along certain discrete attributes or facets of the overall data collection. Selecting fewer facets for aggregation may help improve retrieval speed. For supported facets, please refer to filter key.

Example:
tags,categories
sort
string

To specify sort order based on attribute values of the requested resource instances, and for multiple sort attributes, separate the sort attributes by commas (,) in the "sort" request parameter.

  • Ascending order: For example, use +relevance to control the returned products to be sorted in ascending order of the relevance.
  • Dscending order: For example, use -price,-relevance to control the returned products to be sorted in descending order of the price, and within each group of products with the same price, products are sorted in descending order of the relevance attribute.

Support sort attributes: relevance, title, price, created_at, updated_at

Default:
-relevance
Example:
-relevance
page
number

The page to query. Maximum page number is bounded by total number of queried products.

>= 1<= 1000
Default:
1
Example:
1
limit
number

The number of products each page contains.

<= 100
Default:
10
Example:
20
Auth
:
Parameters
:
:
Body
preparing...