Smart Discovery API reference
Learn how to make a Smart Discovery API request to retrieve Smart Discovery data.
For more information about Smart Discovery, see Feature: Smart Discovery.
Requests
URL
The URL for Smart Discovery API requests is https://<platform_instance>/smartDiscoveryApi?method=strategy
, where <platform_instance>
is the domain name of your Frosmo Platform instance.
To get the URL for your Frosmo Platform instance:
-
In the header, click your username, and select API Access.
-
In the Smart Discovery section, copy the URL.
Authentication
The Smart Discovery API does not require authentication.
Methods
The Smart Discovery API supports the GET HTTP method for retrieving Smart Discovery data.
Syntax
To retrieve Smart Discovery data, make the following GET request:
GET https://<platform_instance>/smartDiscoveryApi?method=strategy&
origin=<site_origin>&
strategy=<strategy_id>&
context=<page_context>&
cookieId=<local_frosmo_id>
Parameters
Parameter | Description | Type | Role | Example |
---|---|---|---|---|
| Request type. Use the value | String | Required |
|
| Site origin. To find out your site's origin, see Getting your site origin. | String | Required |
|
| ID of the Smart Discovery strategy whose generated data to retrieve. | String | Required |
|
| Contextual information about the page where the API request is made. The information allows the API to return the correct Smart Discovery data for the page. The exact information required depends on the page type of the Smart Discovery strategy. The value is a JSON object containing a single | Object See Page context object. | Required |
|
| Frosmo ID of the visitor who sees the Smart Discovery. The platform uses the ID to sort the collections in the Smart Discovery based on the visitor's affinities. To get the ID, see Getting a visitor's Frosmo ID. This parameter is required if you want to personalize the Smart Discovery for individual visitors. note Do not set this parameter if the site uses selective profiling and the visitor has opted out. | String | Optional |
|
| Login ID of the visitor who sees the Smart Discovery. The ID allows the platform to get the visitor's affinity profile across multiple browsers. note For the login ID to work on a site, login support must be enabled for the site. To enable the feature, if it's not already enabled, contact Frosmo support. | String | Optional |
|
| Maximum number of collections to return in the Smart Discovery data. The API returns the top collections by relevance (as determined by item popularity and the visitor's affinities). The minimum value is The default value is | Number | Optional |
|
| Define the visitor's profiling choice if the site uses selective profiling. The choice determines whether the API returns Smart Discovery data that is personalized for the visitor. The possible values are:
The default value is empty. Each visitor's profiling choice is stored in their context. You can get the choice using the note You must always define this parameter on a site that uses selective profiling. Never define this parameter on a site that does not use selective profiling. How the profiling choice worksIf you set the value to If you set the value to | String | Optional |
|
| Define whether to return debugging information about the request. warning Use the debugging information only for development and testing purposes. Do not use the information in production, since Frosmo does not guarantee that the information structure and content will remain the same. The debugging information consists of:
The possible values are:
The default value is | Boolean | Optional |
|
Page context object
The following table describes the page
object of the context
parameter value. The page
object provides contextual information about the page where the API request is made.
Property | Description | Type | Role | Example |
---|---|---|---|---|
| Type of the page where the API request is made. The possible values are:
note The value must match the page type of the Smart Discovery strategy. | String | Required |
|
| Contextual information about the brand page where the API request is made. This property is required only if the | Required |
| |
| Contextual information about the category page where the API request is made. This property is required only if the | Required |
|
Brand page context object
The following table describes the brand
object of the page context object. The brand
object provides contextual information about the brand page where the API request is made.
Property | Description | Type | Role | Example |
---|---|---|---|---|
| Name of the brand. Smart Discovery uses exact matching to check the brand name against brand-based discoveries generated for the site. For example, if the current brand page is For more information about the returned data, see Responses. | String | Required |
|
Category page context object
The following table describes the category
object of the page context object. The category
object provides contextual information about the category page where the API request is made.
Property | Description | Type | Role | Example |
---|---|---|---|---|
| Names of the categories whose items are shown on the category page where the API request is made. Smart Discovery only uses the first name in the array. Make sure the first name is the category whose Smart Discovery data you want to retrieve. Smart Discovery uses "starts with" partial matching to check the category name against category-based discoveries generated for the site. For example:
For more information about the returned data, see Responses. | Array of strings | Required |
|
Request examples
GET https://inpref.com/smartDiscoveryApi?method=strategy&
origin=shop_company_com&
strategy=home&
context={
"page": {
"type": "home"
}
}&
cookieId=dsr77t.kstzihlx
GET https://inpref.com/smartDiscoveryApi?method=strategy&
origin=shop_company_com&
strategy=category&
context={
"page": {
"type": "category",
"category": {
"categories": [
"Fashion/Shoes"
]
}
}
}&
cookieId=dsr77t.kstzihlx
GET https://inpref.com/smartDiscoveryApi?method=strategy&
origin=shop_company_com&
strategy=category&
context={
"page": {
"type": "category",
"category": {
"categories": [
"Fashion/Shoes"
]
}
}
}&
cookieId=dsr77t.kstzihlx&
limit=10