---
title: V1 (deprecated)
slug: apis/smart-search-apis-v1
docTags: 
createdAt: 2022-04-17T13:15:50.000Z
---

:::hint{type="warning"}
The v1 APIs are now deprecated! If you are building a new implementation, we strongly recommend using API version 2 by going through V2 [Overview](docId\:cZeodl0sKcuv-18IPupLr)&#x20;
:::

Depending on what details you want Klevu Search servers to return in response, you can use one of the following API methods to search in your index.

- For the “search as you type” sort of interface where you need query suggestions, matching categories, CMS pages and product suggestions, please use the “Search As You Type” method.
- For the search results landing page, if you only need a list of IDs of records relevant to your query, use the ID Search method.
- In addition to record IDs, if you want Klevu Search to return other details such as name, description, price, etc., use the Record Search method.

Both the ID Search and the Record Search methods have parameters that allow you to fetch filters/facets as well.

## Search As You Type

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://<cloudSearchURL>/cloud-search/n-search/search",
  "name": "Search as you type",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "ticket",
        "type": "string",
        "description": "This is your Klevu JS API Key."
      },
      {
        "kind": "required",
        "name": "term",
        "type": "string",
        "description": "The actual term or a phrase searched by the shopper."
      },
      {
        "kind": "required",
        "name": "sv",
        "type": "string",
        "description": "The sv parameter is used for indicating which version of the Klevu Magento plugin you are using (e.g. 1.2.5). In case of a non-magento store, please use the constant value 20.0.0."
      },
      {
        "kind": "optional",
        "name": "autoComplete",
        "type": "Boolean",
        "description": "If true, the autosuggestions matching the submitted query terms are returned. \nDefault value is false. \t"
      },
      {
        "kind": "optional",
        "name": "typeOfSuggestions",
        "type": "string",
        "description": "Used for specifying the kind of non-product suggestions (e.g. cms, category etc.) needed to be fetched. Use \":\" as a separator. Possible values: cms, category"
      },
      {
        "kind": "optional",
        "name": "noOfResults",
        "type": "Integer",
        "description": "Indicates the number of records to be fetched for each type of suggestions. For example, if set to 3, then 3 products, 3 categories and 3 cms pages will be returned."
      },
      {
        "kind": "optional",
        "name": "noOfResultsAC",
        "type": "Integer",
        "description": "Number of autocomplete suggestions to return."
      },
      {
        "kind": "optional",
        "name": "enablePartialSearch",
        "type": "Boolean",
        "description": "If true, the partial search is enabled. For example, searching for let may fetch both letter as well as tablet."
      },
      {
        "kind": "optional",
        "name": "sortOrder",
        "type": "string",
        "description": "If you want to sort results in certain order. please use one of the following values:\n- rel for Relevance,\n- lth for Price: Low to High,\n- htl for Price: High to Low."
      },
      {
        "kind": "optional",
        "name": "showOutOfStockProducts",
        "type": "Boolean",
        "description": "True to include out of stock products in the search result set, false otherwise. "
      },
      {
        "kind": "optional",
        "name": "priceFieldSuffix",
        "type": "string",
        "description": "If you are a shopify plus customer with the multicurrency feature enabled, you can now provide a currency (other than the base currency of your store), to fetch prices in that currency. If in case the prices are not available in the supplied currency, Klevu will return prices in the base currency of the store. e.g. priceFieldSuffix=USD"
      },
      {
        "kind": "optional",
        "name": "visibility",
        "type": "string",
        "description": "Always set this parameter to search to include products with the visibility of search to be included in the result set."
      },
      {
        "kind": "optional",
        "name": "resultForZero",
        "type": "Number",
        "description": "In case the original query does not produce any result, setting this parameter to value 1, will bring products that are most popular on the site or are popular in the recentCategory as below."
      },
      {
        "kind": "optional",
        "name": "recentCategory",
        "type": "string",
        "description": "Name of a category whose product was clicked most recently. this parameter is used in conjuction with resultForZero parameter to produce suggestions in case no result is found for the query."
      },
      {
        "kind": "optional",
        "name": "noOfResultsZero",
        "type": "Integer",
        "description": "If the fallback results are enabled for when there is no result found for a query, this parameter tells how many results should be retrieved."
      },
      {
        "kind": "optional",
        "name": "optionalFilters",
        "type": "string",
        "description": "A parameter to enable personalisation. It instructs Klevu to boost products with the filter values specified here. In case of multiple filters, please use the double semicolon (;;) as a delimiter\n\nWith each filter value, one can assign a boost score.\n\nFor example, if in past a user was seen preferring green color products over any other color and brand to be nike, one can specify the optionalFilters as the following:\n\ne.g. color:green^10;;brand:nike^3.0\n\nHere, use ;; as a delimiter between two filter values and a score between 1 and 100 to boost filter options.\n\nValues provided here should be the strings taken from the value attribute of the option element under the filters."
      },
      {
        "kind": "optional",
        "name": "responseType",
        "type": "string",
        "description": "Type of response to be returned. Possible values are xml or json"
      }
    ],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "DdxomvWNISlr_Jx48gHQd",
        "code": "{\n    \"meta\": {\n        \"layoutId\": \"\",\n        \"layoutType\": \"\",\n        \"noOfResults\": 2,\n        \"paginationStartFrom\": 0,\n        \"powerdByLogo\": \"\",\n        \"totalResultsFound\": 404,\n        \"typeOfQuery\": \"WILDCARD_AND\",\n        \"storeBaseCurrency\": \"GBP\",\n        \"notificationCode\": 1,\n        \"term\": \"r\",\n        \"excludeIds\": null,\n        \"isPersonalised\": false,\n        \"idsUsedForPersonalisation\": null\n    },\n    \"result\": [\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"Fitness Equipment\",\n            \"itemGroupId\": \"4384059883582\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"GBP\",\n            \"price\": \"19.00\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/ug05-gr-0_e8c85261-d103-4b09-9460-d8e0a2db97f5_medium.jpg?v=1575478397\",\n            \"currency\": \"GBP\",\n            \"inStock\": \"yes\",\n            \"id\": \"31366497206334\",\n            \"imageHover\": \"\",\n            \"sku\": \"24-UG05\",\n            \"brand\": \"KSD\",\n            \"startPrice\": \"\",\n            \"image\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/ug05-gr-0_e8c85261-d103-4b09-9460-d8e0a2db97f5_medium.jpg?v=1575478397\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"19.0\",\n            \"oldPrice\": \"19.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_PRODUCT;Products;;Accessories;;Fitness Equipment  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/products/go-getr-pushup-grips\",\n            \"tags\": \"Durable, Grips, pushup\",\n            \"name\": \"Go-Get'r Pushup Grips\",\n            \"shortDesc\": \"The Go-Get'r Pushup Grips safely provide the extra range of motion you need for a deep-dip routine targeting core, shoulder, chest and arm strength. Do fewer pushups using more energy, getting better results faster than the standard floor-level te\",\n            \"category\": \"Accessories;;Fitness Equipment\",\n            \"typeOfRecord\": \"KLEVU_PRODUCT\"\n        },\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"Jackets\",\n            \"itemGroupId\": \"4384032915518\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"GBP\",\n            \"price\": \"60.00\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj05-red_main_f6c5dcb4-59e1-42cd-aeb6-3faf067c4935_medium.jpg?v=1575477999\",\n            \"currency\": \"GBP\",\n            \"inStock\": \"yes\",\n            \"id\": \"31366455066686\",\n            \"imageHover\": \"\",\n            \"sku\": \"WJ05-XS-Red\",\n            \"brand\": \"KKE\",\n            \"startPrice\": \"\",\n            \"image\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/wj05-red_main_f6c5dcb4-59e1-42cd-aeb6-3faf067c4935_medium.jpg?v=1575477999\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"60.0\",\n            \"oldPrice\": \"60.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_PRODUCT;Products;;Jackets  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/products/riona-full-zip-jacket-red\",\n            \"tags\": \"comfort, machine, royal, running, zipped\",\n            \"size\": \"Medium\",\n            \"name\": \"Riona Full Zip Jacket\",\n            \"shortDesc\": \"The Riona Basic Zip Jacket makes the perfect extra layer for cold-weather workouts. It features amazing breathability and moisture management, but full-length zipper lets you moderate your core temperature even more. • Brown heather full zi\",\n            \"category\": \"Jackets\",\n            \"typeOfRecord\": \"KLEVU_PRODUCT\"\n        }\n    ],\n    \"filters\": [],\n    \"price\": {\n        \"min\": \"\",\n        \"max\": \"\",\n        \"start\": \"\",\n        \"end\": \"\"\n    },\n    \"autoComplete\": [],\n    \"popularTerm\": [],\n    \"pages\": [\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"pages\",\n            \"itemGroupId\": \"page_50756288574\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"EUR\",\n            \"price\": \"0.0\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"\",\n            \"currency\": \"EUR\",\n            \"inStock\": \"yes\",\n            \"id\": \"page_50756288574\",\n            \"imageHover\": \"\",\n            \"startPrice\": \"\",\n            \"image\": \"\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"0.0\",\n            \"oldPrice\": \"0.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_CMS  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/pages/recipe-fish-chips\",\n            \"name\": \"Recipe: Fish & Chips\",\n            \"shortDesc\": \"Just a test recipe for Fish & Chips.\",\n            \"typeOfRecord\": \"KLEVU_CMS\"\n        },\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"pages\",\n            \"itemGroupId\": \"page_53478424638\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"EUR\",\n            \"price\": \"0.0\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"\",\n            \"currency\": \"EUR\",\n            \"inStock\": \"yes\",\n            \"id\": \"page_53478424638\",\n            \"imageHover\": \"\",\n            \"startPrice\": \"\",\n            \"image\": \"\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"0.0\",\n            \"oldPrice\": \"0.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_CMS  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/pages/search-results\",\n            \"name\": \"Search Results\",\n            \"shortDesc\": \"\",\n            \"typeOfRecord\": \"KLEVU_CMS\"\n        }\n    ],\n    \"categories\": [],\n    \"popularProducts\": [],\n    \"recentlyViewedProducts\": [],\n    \"ranges\": [],\n    \"error\": {\n        \"errorMessage\": \"\"\n    }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "DdxomvWNISlr_Jx48gHQd"
  },
  "examples": {
    "languages": [
      {
        "id": "ewnRZCOKsK8s4PdjFvhyM",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://eucs15.ksearchnet.com/cloud-search/n-search/search?ticket=klevu-156925593843210765&term=r&sv=20.0.0&autoComplete=false&autoCompleteFilters=category:cms&noOfResults=2&showOutOfStockProducts=false&responseType=json',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "ewnRZCOKsK8s4PdjFvhyM"
  },
  "description": "Use this API endpoint to build a search as you type solution. It produces query suggestions, category suggestions, CMS page suggestions and products matching the customer query.\n",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "search-as-you-type-1",
  "legacyHash": "69i_-L-XlhGvweGovwvrH"
}
```
:::

## Record Search

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://<cloudSearchURL>/cloud-search/n-search/search",
  "name": "Record search",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "ticket",
        "type": "string",
        "description": "This is your Klevu JS API Key."
      },
      {
        "kind": "required",
        "name": "term",
        "type": "string",
        "description": "The actual term or a phrase searched by the shopper."
      },
      {
        "kind": "required",
        "name": "sv",
        "type": "string",
        "description": "The sv parameter is used for indicating which version of the Klevu Magento plugin you are using (e.g. 1.2.5). In case of a non-magento store, please use the constant 20.0.0"
      },
      {
        "kind": "optional",
        "name": "paginationStartsFrom",
        "type": "Integer",
        "description": "Index of the first record to be fetched. If for example showing 12 results per page, use the index 12 for the second page and 24 for the third page and so on.  Default value is 0."
      },
      {
        "kind": "optional",
        "name": "noOfResults",
        "type": "Number",
        "description": "Indicates the number of records to be fetched. If for example, paginationStartsFrom is set to 0, it will obtain results from 0. Default value is 12. "
      },
      {
        "kind": "optional",
        "name": "enablePartialSearch",
        "type": "Boolean",
        "description": "If true, the partial search is enabled. For example, searching for let may fetch letter as well as tablet. Default value is false. "
      },
      {
        "kind": "optional",
        "name": "category",
        "type": "string",
        "description": "To filter results by specific category.\n\nTo fetch only products use KLEVU_PRODUCT as a value.\nTo fetch only Category pages, use KLEVU_CATEGORY as a value.\nTo fetch only CMS pages, use KLEVU_CMS as a value.\n\nUse ~.~ as a delimiter when supplying more than one values.\n\ne.g. KLEVU_PRODUCT~.~electronics~.~furniture\n\nThis will search for “products” where the category is either electronics or furniture."
      },
      {
        "kind": "optional",
        "name": "enableFilters",
        "type": "Boolean",
        "description": "If set to true, filters relevant to the search results are retrieved and included in the response. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "enableMultiSelectFilters",
        "type": "Boolean",
        "description": "If set to true, we treat different values of a filter as checkboxes. Otherwise, if set to false, they are treated as radio buttons.\n\ne.g. color:green;;color:white;;brand:nike\nWhen set to true, it finds products with either green OR white color with the brand nike. When set to false, it finds products with both green AND white color AND brand nike. Default value is false. "
      },
      {
        "kind": "optional",
        "name": "applyFilters",
        "type": "string",
        "description": "Tells Klevu which filters to apply on the search results. In case of multiple filters, please use the double semicolon (;;) as the delimiter.\n\nValues provided here should be the strings taken from the value attribute of the option element under the filters.\n\ne.g. color:green;;color:white;;brand:nike"
      },
      {
        "kind": "optional",
        "name": "maxNoOfValuesInAFilter",
        "type": "Integer",
        "description": "Number of values to return for each filter. The default is 50. "
      },
      {
        "kind": "optional",
        "name": "sortOrder",
        "type": "string",
        "description": "If you want to sort results in certain order, please use one of the following values:\n- rel for Relevance,\n- lth for Price: Low to High,\n- htl for Price: High to Low. \nThe default value is rel. "
      },
      {
        "kind": "optional",
        "name": "showOutOfStockProducts",
        "type": "Boolean",
        "description": "True to include out of stock products in the search result set, false otherwise. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "fetchMinMaxPrice",
        "type": "Boolean",
        "description": "If set to true, it returns the minimum and maximum prices found for the obtained search results. This can be used, for example, for displaying price slider. If set to false, Klevu will return price ranges (e.g. 0-500, 500-1000 etc.). The price range intervals are dynamically generated by Klevu. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "priceFieldSuffix",
        "type": "string",
        "description": "If you are a shopify plus customer with the multicurrency feature enabled, you can now provide a currency (other than the base currency of your store), to fetch prices in that currency. If in case the prices are not available in the supplied currency, Klevu will return prices in the base currency of the store. e.g. priceFieldSuffix=USD"
      },
      {
        "kind": "optional",
        "name": "visibility",
        "type": "string",
        "description": "Always set this parameter to search to include products with the visibility of search to be included in the result set. The default value is search. "
      },
      {
        "kind": "optional",
        "name": "resultForZero",
        "type": "Integer",
        "description": "In case the original query does not produce any result, setting this parameter to value 1, will bring products that are most popular on the site or are popular in the recentCategory as below. The default value is 0. "
      },
      {
        "kind": "optional",
        "name": "recentCategory",
        "type": "string",
        "description": "Name of a category whose product was clicked most recently. this parameter is used in conjuction with resultForZero parameter to produce suggestions in case no result is found for the query."
      },
      {
        "kind": "optional",
        "name": "noOfResultsZero",
        "type": "Integer",
        "description": "If the fallback results are enabled for when there is no result found for a query, this parameter tells how many results should be retrieved. The default value is 5."
      },
      {
        "kind": "optional",
        "name": "optionalFilters",
        "type": "string",
        "description": "A parameter to enable personalisation. It instructs Klevu to boost products with the filter values specified here. In case of multiple filters, please use the double semicolon (;;) as a delimiter\n\nWith each filter value, one can assign a boost score.\n\nFor example, if in past a user was seen preferring green color products over any other color and brand to be nike, one can specify the optionalFilters as the following:\n\ne.g. color:green^10;;brand:nike^3.0\n\nHere, use ;; as a delimiter between two filter values and a score between 1 and 100 to boost filter options.\n\nValues provided here should be the strings taken from the value attribute of the option element under the filters."
      },
      {
        "kind": "optional",
        "name": "responseType",
        "type": "string",
        "description": "Type of response to be returned. Possible values are xml or json. The default value is xml. "
      },
      {
        "kind": "optional",
        "name": "lsqt",
        "type": "string",
        "description": "When you receive a response for a search query, look at the value of the typeOfQuery element under the metaData section. When you fire a subsequent query (e.g. to apply additional filters, or to obtain results for the next page), pass this value as the value of the lsqt (last search query type) parameter.  Possible values are WILDCARD_AND, FUZZY_AND, OR, FUZZY_OR. "
      },
      {
        "kind": "optional",
        "name": "fl",
        "type": "string",
        "description": "When Klevu returns search results, the response has certain fields for each record included. If you like to retrieve only a set of selected filters, use a list of comma separated field names."
      }
    ],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "DdxomvWNISlr_Jx48gHQd",
        "code": "{\n    \"meta\": {\n        \"layoutId\": \"\",\n        \"layoutType\": \"\",\n        \"noOfResults\": 2,\n        \"paginationStartFrom\": 0,\n        \"powerdByLogo\": \"\",\n        \"totalResultsFound\": 448,\n        \"typeOfQuery\": \"WILDCARD_AND\",\n        \"storeBaseCurrency\": \"GBP\",\n        \"notificationCode\": 1,\n        \"term\": \"a\",\n        \"excludeIds\": null,\n        \"isPersonalised\": false,\n        \"idsUsedForPersonalisation\": null\n    },\n    \"result\": [\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"Watches\",klevu\n            \"itemGroupId\": \"4384059326526\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"GBP\",\n            \"price\": \"45.00\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg04-bk-0_b0a2adf9-f0c0-4814-8aa7-e421120afb06_medium.jpg?v=1575478388\",\n            \"currency\": \"GBP\",\n            \"inStock\": \"yes\",\n            \"id\": \"31366496616510\",\n            \"imageHover\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg04-bk-0_1024x1024_1_cb15759f-9c8c-4899-a68a-e379c5fe3735_medium.jpg?v=1575478388\",\n            \"sku\": \"24-MG04\",\n            \"brand\": \"KSD\",\n            \"startPrice\": \"\",\n            \"image\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg04-bk-0_b0a2adf9-f0c0-4814-8aa7-e421120afb06_medium.jpg?v=1575478388\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"45.0\",\n            \"oldPrice\": \"45.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_PRODUCT;Products;;Watches  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/products/aim-analog-watch\",\n            \"tags\": \"analog, strap fit, watch\",\n            \"size\": \"Free Size\",\n            \"name\": \"Aim Analog Watch\",\n            \"shortDesc\": \"Stay light-years ahead of the competition with our Aim Analog Watch. The flexible, rubberized strap is contoured to conform to the shape of your wrist for a comfortable all-day fit. The face features three illuminated hands, a digital read-out of\",\n            \"category\": \"Watches\",\n            \"typeOfRecord\": \"KLEVU_PRODUCT\"\n        },\n        {\n            \"discount\": \"\",\n            \"hideGroupPrices\": \"\",\n            \"type\": \"Watches\",\n            \"itemGroupId\": \"4384058933310\",\n            \"freeShipping\": \"\",\n            \"storeBaseCurrency\": \"GBP\",\n            \"price\": \"55.00\",\n            \"toPrice\": \"\",\n            \"imageUrl\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg05-br-0_5300c0c5-9008-480a-ab61-cd7a670d18e0_medium.jpg?v=1575478382\",\n            \"currency\": \"GBP\",\n            \"inStock\": \"yes\",\n            \"id\": \"31366496124990\",\n            \"imageHover\": \"\",\n            \"sku\": \"24-MG05\",\n            \"brand\": \"KSD\",\n            \"startPrice\": \"\",\n            \"image\": \"https://cdn.shopify.com/s/files/1/0116/9457/1582/products/mg05-br-0_5300c0c5-9008-480a-ab61-cd7a670d18e0_medium.jpg?v=1575478382\",\n            \"deliveryInfo\": \"\",\n            \"hideAddToCart\": \"\",\n            \"salePrice\": \"55.0\",\n            \"oldPrice\": \"55.0\",\n            \"swatches\": {\n                \"swatch\": [],\n                \"lowestPrice\": \"\",\n                \"numberOfAdditionalVariants\": \"\"\n            },\n            \"weight\": \"\",\n            \"klevu_category\": \"KLEVU_PRODUCT;Products;;Watches  @ku@kuCategory@ku@\",\n            \"totalVariants\": \"0\",\n            \"groupPrices\": \"\",\n            \"url\": \"https://jsv2-shopify-demo.ksearchmisc.com/products/cruise-dual-analog-watch\",\n            \"tags\": \"analog, cruise, leather band, watch\",\n            \"size\": \"Free Size\",\n            \"name\": \"Cruise Dual Analog Watch\",\n            \"shortDesc\": \"Whether you're traveling or wish you were, you'll never let time zones perplex you again with the Cruise Dual Analog Watch. The thick, adjustable band promises a comfortable, personalized fit to this classy, modern time piece. Two dia\",\n            \"category\": \"Watches\",\n            \"typeOfRecord\": \"KLEVU_PRODUCT\"\n        }\n    ],\n    \"filters\": [],\n    \"price\": {\n        \"min\": \"\",\n        \"max\": \"\",\n        \"start\": \"\",\n        \"end\": \"\"\n    },\n    \"autoComplete\": [],\n    \"popularTerm\": [],\n    \"pages\": [],\n    \"categories\": [],\n    \"popularProducts\": [],\n    \"recentlyViewedProducts\": [],\n    \"ranges\": [],\n    \"error\": {\n        \"errorMessage\": \"\"\n    }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "DdxomvWNISlr_Jx48gHQd"
  },
  "examples": {
    "languages": [
      {
        "id": "uQ140yeowlCssb8Z1TFzR",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://eucs15.ksearchnet.com/cloud-search/n-search/search?ticket=klevu-156925593843210765&term=a&sv=20.0.0&paginationStartsFrom=0&noOfResults=2&enablePartialSearch=false&category=KLEVU_PRODUCT&enableFilters=false&enableMultiSelectFilters=false&showOutOfStockProducts=true&responseType=json',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "uQ140yeowlCssb8Z1TFzR"
  },
  "description": "Use this API method if you want not only the record IDs but also other details associated with the matching records. The method allows you to retrieve facets and autosuggestions as well.\n",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "record-search-1",
  "legacyHash": "EEMY_OqxFW3qUjQkt1twQ"
}
```
:::

## ID search

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://<cloudSearchURL>/cloud-search/n-search/idsearch",
  "name": "ID search",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "ticket",
        "type": "string",
        "description": "This is your Klevu JS API Key."
      },
      {
        "kind": "required",
        "name": "term",
        "type": "string",
        "description": "The actual term or a phrase searched by the shopper."
      },
      {
        "kind": "required",
        "name": "sv",
        "type": "string",
        "description": "The sv parameter is used for indicating which version of the Klevu Magento plugin you are using (e.g. 1.2.5). In case of a non-magento store, please use the constant 20.0.0"
      },
      {
        "kind": "optional",
        "name": "paginationStartsFrom",
        "type": "Integer",
        "description": "Index of the first record to be fetched. If for example showing 12 results per page, use the index 12 for the second page and 24 for the third page and so on.  Default value is 0."
      },
      {
        "kind": "optional",
        "name": "noOfResults",
        "type": "Number",
        "description": "Indicates the number of records to be fetched. If for example, paginationStartsFrom is set to 0, it will obtain results from 0. Default value is 12. "
      },
      {
        "kind": "optional",
        "name": "enablePartialSearch",
        "type": "Boolean",
        "description": "If true, the partial search is enabled. For example, searching for let may fetch letter as well as tablet. Default value is false. "
      },
      {
        "kind": "optional",
        "name": "category",
        "type": "string",
        "description": "To filter results by specific category.\n\nTo fetch only products use KLEVU_PRODUCT as a value.\nTo fetch only Category pages, use KLEVU_CATEGORY as a value.\nTo fetch only CMS pages, use KLEVU_CMS as a value.\n\nUse ~.~ as a delimiter when supplying more than one values.\n\ne.g. KLEVU_PRODUCT~.~electronics~.~furniture\n\nThis will search for “products” where the category is either electronics or furniture."
      },
      {
        "kind": "optional",
        "name": "enableFilters",
        "type": "Boolean",
        "description": "If set to true, filters relevant to the search results are retrieved and included in the response. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "enableMultiSelectFilters",
        "type": "Boolean",
        "description": "If set to true, we treat different values of a filter as checkboxes. Otherwise, if set to false, they are treated as radio buttons.\n\ne.g. color:green;;color:white;;brand:nike\nWhen set to true, it finds products with either green OR white color with the brand nike. When set to false, it finds products with both green AND white color AND brand nike. Default value is false. "
      },
      {
        "kind": "optional",
        "name": "applyFilters",
        "type": "string",
        "description": "Tells Klevu which filters to apply on the search results. In case of multiple filters, please use the double semicolon (;;) as the delimiter.\n\nValues provided here should be the strings taken from the value attribute of the option element under the filters.\n\ne.g. color:green;;color:white;;brand:nike"
      },
      {
        "kind": "optional",
        "name": "maxNoOfValuesInAFilter",
        "type": "Integer",
        "description": "Number of values to return for each filter. The default is 50. "
      },
      {
        "kind": "optional",
        "name": "sortOrder",
        "type": "string",
        "description": "If you want to sort results in certain order, please use one of the following values:\n- rel for Relevance,\n- lth for Price: Low to High,\n- htl for Price: High to Low. \nThe default value is rel. "
      },
      {
        "kind": "optional",
        "name": "showOutOfStockProducts",
        "type": "Boolean",
        "description": "True to include out of stock products in the search result set, false otherwise. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "fetchMinMaxPrice",
        "type": "Boolean",
        "description": "If set to true, it returns the minimum and maximum prices found for the obtained search results. This can be used, for example, for displaying price slider. If set to false, Klevu will return price ranges (e.g. 0-500, 500-1000 etc.). The price range intervals are dynamically generated by Klevu. The default value is false. "
      },
      {
        "kind": "optional",
        "name": "priceFieldSuffix",
        "type": "string",
        "description": "If you are a shopify plus customer with the multicurrency feature enabled, you can now provide a currency (other than the base currency of your store), to fetch prices in that currency. If in case the prices are not available in the supplied currency, Klevu will return prices in the base currency of the store. e.g. priceFieldSuffix=USD"
      },
      {
        "kind": "optional",
        "name": "visibility",
        "type": "string",
        "description": "Always set this parameter to search to include products with the visibility of search to be included in the result set. The default value is search. "
      },
      {
        "kind": "optional",
        "name": "resultForZero",
        "type": "Integer",
        "description": "In case the original query does not produce any result, setting this parameter to value 1, will bring products that are most popular on the site or are popular in the recentCategory as below. The default value is 0. "
      },
      {
        "kind": "optional",
        "name": "recentCategory",
        "type": "string",
        "description": "Name of a category whose product was clicked most recently. this parameter is used in conjuction with resultForZero parameter to produce suggestions in case no result is found for the query."
      },
      {
        "kind": "optional",
        "name": "noOfResultsZero",
        "type": "Integer",
        "description": "If the fallback results are enabled for when there is no result found for a query, this parameter tells how many results should be retrieved. The default value is 5."
      },
      {
        "kind": "optional",
        "name": "optionalFilters",
        "type": "string",
        "description": "A parameter to enable personalisation. It instructs Klevu to boost products with the filter values specified here. In case of multiple filters, please use the double semicolon (;;) as a delimiter\n\nWith each filter value, one can assign a boost score.\n\nFor example, if in past a user was seen preferring green color products over any other color and brand to be nike, one can specify the optionalFilters as the following:\n\ne.g. color:green^10;;brand:nike^3.0\n\nHere, use ;; as a delimiter between two filter values and a score between 1 and 100 to boost filter options.\n\nValues provided here should be the strings taken from the value attribute of the option element under the filters."
      },
      {
        "kind": "optional",
        "name": "responseType",
        "type": "string",
        "description": "Type of response to be returned. Possible values are xml or json. The default value is xml. "
      },
      {
        "kind": "optional",
        "name": "lsqt",
        "type": "string",
        "description": "When you receive a response for a search query, look at the value of the typeOfQuery element under the metaData section. When you fire a subsequent query (e.g. to apply additional filters, or to obtain results for the next page), pass this value as the value of the lsqt (last search query type) parameter.  Possible values are WILDCARD_AND, FUZZY_AND, OR, FUZZY_OR. "
      },
      {
        "kind": "optional",
        "name": "fl",
        "type": "string",
        "description": "When Klevu returns search results, the response has certain fields for each record included. If you like to retrieve only a set of selected filters, use a list of comma separated field names."
      }
    ],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "DdxomvWNISlr_Jx48gHQd",
        "code": "{\n    \"meta\": {\n        \"layoutId\": \"\",\n        \"layoutType\": \"\",\n        \"noOfResults\": 2,\n        \"paginationStartFrom\": 0,\n        \"powerdByLogo\": \"\",\n        \"totalResultsFound\": 398,\n        \"typeOfQuery\": \"WILDCARD_AND\",\n        \"storeBaseCurrency\": \"\",\n        \"notificationCode\": 1,\n        \"term\": \"r\",\n        \"excludeIds\": null,\n        \"isPersonalised\": false,\n        \"idsUsedForPersonalisation\": null\n    },\n    \"result\": [\n        {\n            \"id\": \"31366497206334\",\n            \"itemGroupId\": \"4384059883582\"\n        },\n        {\n            \"id\": \"31366455066686\",\n            \"itemGroupId\": \"4384032915518\"\n        }\n    ],\n    \"filters\": [],\n    \"price\": {\n        \"min\": \"\",\n        \"max\": \"\",\n        \"start\": \"\",\n        \"end\": \"\"\n    },\n    \"autoComplete\": [],\n    \"popularTerm\": [],\n    \"pages\": [],\n    \"categories\": [],\n    \"popularProducts\": [],\n    \"recentlyViewedProducts\": [],\n    \"ranges\": [],\n    \"error\": {\n        \"errorMessage\": \"\"\n    }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "DdxomvWNISlr_Jx48gHQd"
  },
  "examples": {
    "languages": [
      {
        "id": "uQ140yeowlCssb8Z1TFzR",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://eucs15.ksearchnet.com/cloud-search/n-search/idsearch?ticket=klevu-156925593843210765&term=r&sv=20.0.0&paginationStartsFrom=0&noOfResults=2&enablePartialSearch=false&category=KLEVU_PRODUCT&enableFilters=false&enableMultiSelectFilters=false&showOutOfStockProducts=false&responseType=json',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "uQ140yeowlCssb8Z1TFzR"
  },
  "description": "Use this API method if you require only the IDs of the records matching your query. The method also allows you to retrieve facets associated with the search results.",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "id-search-1",
  "legacyHash": "s_PquW4wS29wJg2AJtEiN"
}
```
:::



