Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Instant Search

Method Objective

The method requests products that match the search query. The method must be called for each entered character of the search query. The search for products starts from the second entered symbol.

Request

EndpointRequest Type
https://api.personaclick.com/searchGET

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequiredUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.
seancestringrequiredUnique ID of the current user session. See "Initialization (REST API)" for information about getting and using User Session ID.
typestringrequiredSearch Type. Should be set to "instant_search" in this case. See the example below.
search_querystringrequiredThe text of the search query.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

404 Not FoundThere are no mandatory parameters in the request.

API Response Data

NameTypeDescription
productsarrayAn array of objects with product information. Each object has the following properties:
  • id – product ID (type: string)
  • name – product name (type: string)
  • url – product page link (type: string)
  • picture – link to the product image in the PersonaClick image repository (type: string)
  • price – product price (type: number)
  • old_price – product old price (type: string, default – 0)
  • currency – product currency (type: string, matches the currency of the PersonaClick account, or the user value set in the settings of the PersonaClick account)
  • price_formatted – formatted product price including currency (type: string)
  • brand – product vendor (type: string)
  • is_new – new arrival product (type: boolean). See the parameter in the product catalog import (XML, HTTP API)
products_totalnumberThe total number of products that match the search query.
search_querystringThe search query text.
categoriesarray

An array of objects with information about the categories matching the search query. Each object has the following properties:

  • id – category ID (type: string)
  • name – category name (type: string)
  • url – category page link (type: string)
  • parent – parent category ID (type: string)
  • alias – wordy category identifier (type: string)

If no links are specified for categories in the product feed, the API will return an empty array for this property.

queriesarrayAn array of objects with relevant popular queries. Each object has the following properties:
  • name – relevant search query (type: string)
  • url – link to a full search page (the format of the link is configured in the PersonaClick account)
collectionsarrayReserved.
statusstringThis property will be available in case of an error and will contain the "error" value.
messagestring

The text of the error if it occurred

Request Example

curl https://api.personaclick.com/search?shop_id=0d42fd8b713d0752776ca589cc0056&did=iVxRcAaGzA&type=instant_search&search_query=To%20be%20or%20not%20to%20be



Full Search

Method Objective

The method requests products that match the full search query and is used to display the search results.

Request

EndpointRequest Type
https://api.personaclick.com/searchGET

Parameters

See the example below. 

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequiredUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.
seancestringrequiredUnique ID of the current user session. See "Initialization (REST API)" for information about getting and using User Session ID.
typestringrequiredSearch Type. Should be set to "full_search" in this case. See the example below.
search_querystringrequiredThe search query text.
limitnumberoptionallyThe maximum number of products in the API response.
pagenumberoptionallyPage number (first page - 1, by default - 1).
offsetnumberoptionallyThe offset relative to the first product in the API response (similar to: (page - 1) * limit and when used simultaneously with page is a priority, by default - 0).
brandsstringoptionallyComma-separated vendor names. If used, the API response will return only the products of the listed vendors. The vendors must be listed in the product feed.
colorsstringoptionallyComma-separated product colors. If used, the API response will return the products of the listed colors. The colors of the product should be specified in the product feed.
price_minnumberoptionallyMinimum product price in API response.
price_maxnumberoptionallyMaximum product price in API response.
categoriesstringoptionallyComma-separated category IDs. If used, the API response will return only those products that are in the specified categories.
category_namesnumberoptionallyUsing the category names in the search. If used, the API will respond with products from categories whose names intersect with the search query. These products will get the lowest priority and will be at the very end of the response. By default - 1.
sort_bystringoptionallySorting products in the API response.
Available values:
  • popular - sorting products by popularity (by default
  • price - sorting by product price
  • discount - sorting by discount (the difference between oldprice and price in the product feed)
sort_dirstringoptionally

Sorting directions for the sort_by parameter.
Available values:

  • asc - ascending sorting
  • desc - downwards sorting (by default)
category_limitnumberoptionallyThe maximum number of categories in the API response matching the search query.
extendednumberoptionally

If the value is 1, the API will return additional product properties in the response: barcode, categories, param. See the descriptions below.

locationsstringoptionallyComma-separated location IDs. If used, the API will return only products available in the specified locations. Locations must be specified in the imported product catalog (XML, HTTP API).
filtersstringoptionally

JSON string with the properties and their values that the products should match in the API response. The data matches the values of the "param" parameter of the product feed/catalog (XML, HTTP API). Format:

{"property1":["value1","value2"],"property2":["value1","value2"]}
excludestringoptionallyComma-separated products IDs to exclude from search results.
input_querystringoptionallyThe search query was entered by the user as is - before using the suggestions.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

404 Not FoundThere are no mandatory parameters in the request.

API Response Dara

NameTypeDescription
htmlstringHTML code of the widget with full search results. Widget template is customizable in PersonaClick account.
productsarrayAn array of objects with product information. Each object has the following properties:
  • id – product ID (type: string)
  • name – product name (type: string)
  • url – product page link (type: string)
  • picture – link to the product image in the PersonaClick image repository (type: string)
  • price – product price (type: number)
  • old_price – product old price (type: string, by default – 0)
  • currency – product currency (type: string, matches the currency of the PersonaClick account, or the user value set in the settings of the PersonaClick account)
  • price_formatted – formatted product price including currency (type: string)
  • brand – product vendor (type: string)
  • is_new – new arrival product (type: boolean). See the parameter in the product catalog import (XML, HTTP API)
  • barcode – product barcode, if it was imported in the product catalog. The value will be available only if using the "extended" parameter in the API request.
  • categories – object array, each of which contains: id - category ID; parent - parent category ID; name - category name. The value will be available only if using the "extended" parameter in the API request.
  • params – object array with pairs of "key" (string), "values" (array) properties. The data matches the values of the "param" parameter of the product feed/catalog (XML, HTTP API). The value will be available only if using the "extended" parameter in the API request.
products_totalnumberThe total number of products that match the search query. The following query parameters do not affect this value: page, limit, and offset.
search_querystringThe search query text.
brandsObject arrayObject array, each containing the name property with the vendor name in the value.
categoriesObject array

An array of objects with information about the categories matching the search query. Each object has the following properties:

  • id – category ID (type: string)
  • name – category name (type: string)
  • url – category page link (type: string)
  • parent – parent category ID (type: string)
  • alias – wordy category identifier (type: string)

If no links are specified for categories in the product feed, the API will return an empty array for this property.

filtersObject

JSON string with properties and their values of all API response products. The data matches the values of the "param" parameter of the product feed/catalog (XML, HTTP API). Format:

{"property1":["value1","value2"],"property2":["value1","value2"]}
popupObjectReserved for the JS SDK internal use
price_rangeObject

The object containing the values of the minimum and maximum price of the products in the API response. Available properties:

  • min - minimum price
  • max - maximum price
queriesarrayReserved.

Request Example

curl https://api.personaclick.com/search?shop_id=0d42fd8b713d0752776ca589cc0056&did=iVxRcAaGzA&type=full_search&seance=QL9Pr0JTYu&search_query=To%20be%20or%20not%20to%20be&input_query=To%20be%20or&limit=20&page=1&filters=%7B%22Alas%22%3A%5B%22poor%22%2C%22Yorick%22%5D%2C%22William%22%3A%5B%22Shakespeare%22%5D%7D


Blank Request

Method Objective

The method allows getting the user's recent search queries, as well as recommended suggestions and products for the user.

Request

EndpointRequest Type
https://api.personaclick.com/search/blankGET

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequiredUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

404 Not FoundThere are no mandatory parameters in the request.

API Response Data

NameTypeDescription
last_queriesObject array

The user's most recent search queries. Each object in the array contains the following properties:

  • name – the search query
  • url – the URL to the full search page with the matching search query
productsObject arrayAn array of objects with product information. Each object has the following properties:
  • id – product ID (type: string)
  • name – product name (type: string)
  • url – product page link (type: string)
  • picture – link to the product image in the PersonaClick image repository (type: string)
  • price – product price (type: number)
  • old_price – product old price (type: string, default – 0)
  • currency – product currency (type: string, matches the currency of the PersonaClick account, or the user value set in the settings of the PersonaClick account)
  • price_formatted – formatted product price including currency (type: string)
last_productsbooleanIf true, then the products property of the API response contains the products recently viewed by the user, otherwise, it contains the recommended products.
suggestsObject arrayUser-relevant suggestions. Each object in the array contains the following properties:
  • name – the search query
  • url – the URL to the full search page with the matching search query

Request Example

curl https://api.personaclick.com/search/blank?shop_id=0d42fd8b713d0752776ca589cc0056&did=iVxRcAaGzA


Resultless Search Queries

Method Objective

The method allows getting a list of no result search queries, as well as the number of such queries for the last 2 weeks.

Request

EndpointRequest Type
https://api.personaclick.com/search/no_result_queriesGET

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenAuthentication failed.
404 Not FoundThere are no mandatory parameters in the request.

API Response Data

The API returns an array of objects, each containing the following properties:

NameTypeDescription
querystringSearch Query
quantitynumberThe number of search queries in the last 2 weeks.

Request Example

curl https://api.personaclick.com/search/no_result_queries?shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef
  • No labels