API - front end integration

Overview

The Hawksearch service enables online retailers and publishers the ability to drive a rich, compelling user experience. This experience drives visitors to the products and information that they are seeking.

Hawksearch provides the ability to power the product listing pages for categories and brand pages on the site in addition to driving the search page on the site. This document will cover integration between an existing site and Hawksearch to drive: Search Results and Landing Pages. The focus will be the API approach.

The Hawksearch Recommendation service requires tracking events from a user on your website. This document also describes the steps to install client side tracking on your website to send relevant data to the Recommendation engine.

Output Formats

The Hawksearch API provides three response formats. JSON, XML, and HTML are currently available.

Domains

Hawksearch has three environments available: Development, Staging/Test and a load-balanced Production. When performing integration, each engine can be accessed by using these domains:

🚧

Before You Begin

Please ensure that your client-specific endpoints are configured before implementing any API integrations. Please refer to this article to learn more about client-specific endpoints and reach out to our CSD team for any questions.

Development Environment

When including the scripts below, please use the appropriate domains for the development environment.

Hawk URL
<https://dev.hawksearch.net/>

Tracking URL
https://enginename.dev.tracking-na.hawksearch.com

Recommendations URL
https://enginename.dev.recs-na.hawksearch.com

Dashboard URL
https://enginename.dev.dashboard-na.hawksearch.com

Staging/Test Environment.

When including the scripts below, please use the appropriate domains for the test environment.

Engine Reference URL
<https://test.hawksearch.net/>

Tracking URL
https://enginename.test.dashboard-na.hawksearch.com

Recommendations URL
https://enginename.test.recs-na.hawksearch.com

Dashboard URL
https://enginename.test.tracking-na.hawksearch.com

Production Environment

When including the scripts below, please use the following domain for the production/live environment.

Engine Reference URL
<https://yourenginename.hawksearch.com/>
This will be provided at time of launch.

Tracking URL
https://enginename.tracking-na.hawksearch.com

Recommendations URL
https://enginename.recs-na.hawksearch.com

Dashboard URL
https://enginename.dashboard-na.hawksearch.com

Sample HawkSearch Engine

As reference, a sample HawkSearch engine exists to test out API usage. This engine exists at:

<https://dev.hawksearch.net/sites/demo/>

The associated User Interface can also be accessed at:

<https://dev.hawksearch.net/sites/demo/_preview/preview.aspx>

Query Hawksearch API

Query parameters can be utilized so that the engine returns back only the relevant content.

Keywords

Parameter Name: keyword

Description: The keyword parameter expects a word or phrase. The keyword value is utilized to execute a keyword search and will return results based on the matching words.

Example:
<https://dev.hawksearch.net/sites/demo/?keyword=boots&hawkoutput=xml>

Facets

Parameter Name: Depends on how it is configured

Description: The facet name is configured in the fields/facets area of the Hawksearch Dashboard. If used, the engine refines the results based on the facets selected. For example, if Patagonia is specified, the results will only show products that are from the Patagonia brand.

Example:
<https://dev.hawksearch.net/sites/demo/?brand=patagonia&hawkoutput=xml>

If you only wish to extract facet values for a specific facet like brand, category out from Hawksearch without requiring to receive any results or other components in the xml you can request that using the hawkfacets parameter in the URL. In this case the xml will only contain data for facet you requested for.

Example: For extracting facet values for a specific facet like brand:
<https://dev.hawksearch.net/sites/demo/?hawkfacets=brand&hawkoutput=xml>

Many Per Page

Parameter Name: mpp

Description: This value determines how many products to show per page. If mpp is not defined, it will default to 12 records per page.

Example:
<https://dev.hawksearch.net/sites/demo/?pg=3&mpp=12&hawkoutput=xml>

Page Number

Parameter Name: pg

Description: This value determines which page to show a result list. If mpp is not defined, it will default to 12 records per page. If pg is not defined, it will default to the first page.

Example:
<https://dev.hawksearch.net/sites/demo/?pg=3&mpp=12&hawkoutput=xml>

Sort

Parameter Name: sort

Description: This value determines how the list will be sorted. Relevance ranking will not apply if a sort value is defined. If sort is not defined, it will default to relevance ranking or a default sort order.

Example:
<https://dev.hawksearch.net/sites/demo/?sort=salepriceasc&hawkoutput=xml>

Search Within

Parameter Name: searchWithin

Description: This value can perform an additional keyword search within existing criteria.

Example:
<https://dev.hawksearch.net/sites/demo/?searchWithin=blue&> keyword=north+face&hawkoutput=xml

Content Type

Parameter Name: it

Description: This parameter is used to select which content type to show from Hawksearch. For example, this is used with displays tabs for products or content search.

Example:
<https://dev.hawksearch.net/sites/demo/>? keyword=patagonia&it=content&hawkoutput=xml

Output

Parameter Name: hawkoutput

Description: This parameter is to indicate what format the response should be. html, xml,json and custom are valid values. When using value custom all components will be returned as the html and you will have the option to request only items be returned in a certain format using the hawkitem list parameter as explained in the next section.

Example:
<https://dev.hawksearch.net/sites/demo/>? keyword=patagonia&it=content&hawkoutput=xml

API Response

Using the sample engine, you can access the JSON response via this URL:

<https://dev.hawksearch.net/sites/demo/?hawkoutput=json>

The JSON response includes:

  • Success
  • Pagination
  • Sorting
  • Results
  • Facets
  • Selections
  • Merchandising
  • Location
  • Target
  • DidYouMean
  • TrackingId
  • MetaRobots
  • HeaderTitle
  • MetaDescription
  • MetaKeywords
  • RelCanonical
  • FeaturedItems
  • Keyword
  • Original
  • PageLayoutId
  • SearchDuration
  • QueryUsedAllKeywords

API Response Examples below display what properties are returned for each element:

Pagination Object

"Pagination": {
      "NofResults": 173,
      "CurrentPage": 1,
      "Items": [
         {
            "Label": "12 Items Per Page",
            "PageSize": 12,
            "IsDefault": true,
            "Selected": true
         },
         {
            "Label": "24 Items Per Page",
            "PageSize": 24,
            "IsDefault": false,
            "Selected": false
         },
         {
            "Label": "36 Items Per Page",
            "PageSize": 36,
            "IsDefault": false,
            "Selected": false
         },
         {
            "Label": "72 Items Per Page",
            "PageSize": 72,
            "IsDefault": false,
            "Selected": false
         }
      ],
      "MaxPerPage": 12,
      "NofPages": 15
   }

Sorting Object

"Sorting": {
      "Value": "score",
      "Items": [
         {
            "Label": "Best Match",
            "Value": "score",
            "IsDefault": true,
            "Selected": true
         },
         {
            "Label": "Price: Lowest to Highest",
            "Value": "salepriceasc",
            "IsDefault": false,
            "Selected": false
         },
         {
            "Label": "Price: Highest to Lowest",
            "Value": "salepricedesc",
            "IsDefault": false,
            "Selected": false
         }
      ]
   }

Results Object

"Results": [
      {
         "Score": 0.005307952,
         "ItemName": "Logo Hat - The North Face",
         "ImageURL": "/assets/1/14/DimThumbnail/{DE7A166C-24F5-453B-B970-A30BD746C21D}.jpg",
         "ImageAlt": "10187",
         "Id": "Item_74303",
         "CustomURL": "/products/logo-hat-the-north-face/",
         "TrackingId": "1213044",
         "Brand": "The North Face",
         "Price": "18",
         "SalePrice": "18",
         "IsOnSale": false,
         "BestFragment": "... - the <b>north<\/b> <b>face<\/b> the logo hat has the <b>north<\/b> <b>face<\/b> logo and &#39;1968&#39; embroidered on this washed cotton twill hat.&#60;br&#62; &#60;br&#62;   men accessories hats & headwear specials sat dec 15th kids women accessories hats & headwear women hats & headwear caps men hats & headwear caps the <b>north<\/b> ...",
         "MinPrice": "18",
         "MaxPrice": "18",
         "MinSalePrice": "0",
         "MaxSalePrice": "0"
      },
      {
         "Score": 7.017364E-4,
         "ItemName": "Baby Llama Beanie",
         "ImageURL": "/assets/1/14/DimThumbnail/The-North-Face-Baby-Llama-Beanie-jake-blue.jpg",
         "ImageAlt": "Llama",
         "Id": "Item_118551",
         "CustomURL": "/products/baby-llama-beanie-/",
         "TrackingId": "1213044",
         "Brand": "The North Face",
         "Price": "25",
         "SalePrice": "11.97",
         "IsOnSale": true,
         "BestFragment": "... design, the <b>north<\/b> <b>face<\/b> baby llama beanie is about the cutest thing you can pull on your baby&#39;s head. made from lightweight acrylic fibers, this <b>north<\/b> <b>face<\/b> hat has a fleece ear band for extra warmth and a soft feel against the skin.&#60;&#47;div&#62;&#60;div&#62;&#38;nbsp&#59;&#60;&#47;div&#62;&#60;&#47;div&#62;&#60;&#47;div&#62; ...",
         "MinPrice": "25",
         "MaxPrice": "25",
         "MinSalePrice": "11.97",
         "MaxSalePrice": "11.97"
      }
   ]

Facets Object

"Facets": [
      {
         "FacetId": 114,
         "Name": "Search within",
         "Field": "",
         "FieldType": "search",
         "FacetType": "search",
         "DisplayType": "default",
         "MaxCount": 0,
         "MinHitCount": 0,
         "NofVisible": 0,
         "ParamName": "",
         "ExpandSelection": false,
         "IsNumeric": false,
         "IsCurrency": false,
         "IsSearch": false,
         "ScrollHeight": 0,
         "ScrollThreshold": 0,
         "TruncateThreshold": 0,
         "SearchThreshold": 0,
         "AlwaysVisible": true,
         "Values": []
      },
      {
         "FacetId": 272,
         "Name": "Brands",
         "Field": "brand",
         "FieldType": "string",
         "FacetType": "checkbox",
         "DisplayType": "scrolling",
         "MaxCount": 500,
         "MinHitCount": 1,
         "NofVisible": 10,
         "ParamName": "brand",
         "ExpandSelection": true,
         "IsNumeric": false,
         "IsCurrency": false,
         "IsSearch": true,
         "ScrollHeight": 150,
         "ScrollThreshold": 10,
         "TruncateThreshold": 0,
         "SearchThreshold": 10,
         "AlwaysVisible": true,
         "Values": [
            {
               "Label": "The North Face",
               "Value": "The North Face"
            },
            {
               "Label": "Patagonia",
               "Value": "Patagonia"
            }
         ]
  },
      {
         "FacetId": 95,
         "Name": "Department",
         "Field": "department",
         "FieldType": "string",
         "FacetType": "checkbox",
         "DisplayType": "scrolling",
         "MaxCount": 200,
         "MinHitCount": 1,
         "NofVisible": 5,
         "ParamName": "department",
         "ExpandSelection": true,
         "IsNumeric": true,
         "IsCurrency": false,
         "IsSearch": true,
         "ScrollHeight": 150,
         "ScrollThreshold": 5,
         "TruncateThreshold": 10,
         "SearchThreshold": 5,
         "AlwaysVisible": true,
         "Values": [
            {
               "Label": "Specials",
               "Value": "Specials"
            },
            {
               "Label": "Sale",
               "Value": "Sale"
            },
            {
               "Label": "Men",
               "Value": "Men"
            },
            {
               "Label": "Women",
               "Value": "Women"
            },
            {
               "Label": "Footwear",
               "Value": "Footwear"
            }
         ]
      }
] 

Selections Object

     "Selections": {
      "department": {
         "Label": "Department",
         "Items": [
            {
               "Label": "Kids",
               "Value": "Kids"
            }
         ]
      }
   }

Merchandising Object

   "Merchandising": {
      "Items": [
         {
            "Zone": "BannerTop",
            "Html": "<img border=\"0\" src=\"http://dev.hawksearch.net/assets/38/images.jpg\" alt=\"The&#32;North&#32;Face\" width=\"411\" height=\"123\" />"
         }
      ]
   }

Merchandising Object with Featured Items

"FeaturedItems":{
	"Items": 
	[
	{
	 "Zone":"FeaturedTop",
	 "Items": 
	[
	 {
	  "Score": 0.005307952,
         "ItemName": "Logo Hat - The North Face",
         "ImageURL": "/assets/1/14/DimThumbnail/{DE7A166C-24F5-453B-B970-  
                    A30BD746C21D}.jpg",
         "ImageAlt": "10187",
         "Id": "Item_74303",
         "CustomURL": "/products/logo-hat-the-north-face/",
         "TrackingId": "1213044",
         "Brand": "The North Face",
         "Price": "18",
         "SalePrice": "18",
        "IsOnSale": false,
         "BestFragment": "... - the <b>north<\/b> <b>face<\/b> the logo hat has the <b>north<\/b> <b>face<\/b> logo and &#39;1968&#39; embroidered on this washed cotton twill hat.&#60;br&#62; &#60;br&#62;   men accessories hats & headwear specials sat dec 15th kids women accessories hats & headwear women hats & headwear caps men hats & headwear caps the <b>north<\/b> ...",
         "MinPrice": "18",
         "MaxPrice": "18",
         "MinSalePrice": "0",
         "MaxSalePrice": "0"
	}
	]
	}
	]
}

Location Object

If Location is not blank, a Redirect Rule generated a target URL for the visitor to go to.

"location": ""

XML

Using the sample engine, you can access the XML response via this URL:

<https://dev.hawksearch.net/sites/demo/?hawkoutput=xml>

The same objects appear, but formatted in XML.

HTML

Using the sample engine, you can access the pre-formatted HTML response via this URL:

<https://dev.hawksearch.net/sites/demo/?hawkoutput=html>

If the HTML format is utilized, also consider Hawksearch’s JavaScript UI integration for an easier integration.

Sample Queries

SAMPLE #1: “I searched for ‘jackets’ having two brands selected.”

Page URL

<https://dev.hawksearch.net/sites/demo/_preview/preview.aspx?keyword=jackets&brand=Burton,Columbia%20Sportswear>

API Call

<https://dev.hawksearch.net/sites/demo/?keyword=jackets&brand=Burton,Columbia%20Sportswear&hawkoutput=json>

SAMPLE #2: “I searched for ‘parka’ that are on sale having the Patagonia brand selected.”

Page URL:

<https://dev.hawksearch.net/sites/demo/_preview/preview.aspx?keyword=parka&brand=Patagonia&department=Sale>

API Call

<https://dev.hawksearch.net/sites/demo/?keyword=parka&brand=Patagonia&department=Sale&hawkoutput=xml>

Spelling Suggestion/Spell Check

In the event that there are no search results returned for a particular keyword being searched for Hawksearch might return a spelling suggestion or spell check override( if you have one set up for the keyword in the Hawksearch backend) as part of the response returned from the API. Depending upon the format of requested API please check the xml or json value for the xml tag on xml responses or DidYouMean property on json response.

You can then choose to generate a link that you can use to display the suggested word to the site user or you can choose to redirect to the search page with the suggested keyword. Based on the requirements discussion of your site if we chose to return the search results for the corrected keyword in the event that we have a certain number (based on how we discuss the business rule) of minimum results for the original keyword automatically redirect to the search page with the corrected keyword then the response will be available on the API as follows.

Scenario 1 (Automatic Replacement)

User searches for “patagon” and we return results for “Patagonia”

Request Url to Hawksearch: <https://dev.hawksearch.net/sites/demo?keyword=patagon>

Response from Hawksearch for the fields related to this functionality:

patagon
patagonia

Scenario 2 (Request for Original Keyword)

User wants to see results for original keyword (Patagon) instead of replaced keyword (Patagonia)

Request Url to Hawksearch: <https://dev.hawksearch.net/sites/demo?keyword=patagon&hawkspellcheck=0>

Response from Hawksearch the fields related to this functionality:


patagon
patagonia

Scenario 3(Regular Request)

User searches for keyword and enough results are returned for original keyword

Request Url to Hawksearch: <https://dev.hawksearch.net/sites/demo?keyword=coat>

Response from Hawksearch for the fields related to this functionality:


coat

True Client IP and User Agent

In order to enable Hawksearch to track results correctly for your site and use the correct IP when tracking the results, please pass in the true client IP and the user-agent when you make the request to Hawksearch.

enginename is the engine ID provided by your Hawksearch Representative. If you don’t have your enginename, please contact your implementation team.

VB.Net Code Sample

Dim qs As URLParameters = New URLParameters(HttpContext.Current.Request.QueryString, "ajax;json;guid;PageId")
Dim HawkSearchUrl As String = “http://dev.hawksearch.net/sites/enginename”
Dim URL As String = HawkSearchUrl & "/" & qs.ToString()
Dim r As HttpWebRequest = WebRequest.Create(URL)

If Request IsNot Nothing Then
    r.UserAgent = Request.UserAgent
    r.Headers.Add("HTTP_TRUE_CLIENT_IP", Request.UserHostAddress)
End If

Dim myCache As New System.Net.CredentialCache()
myCache.Add(New Uri(URL), "Basic", New System.Net.NetworkCredential(AppSettings("WindowsAuthLogin"), AppSettings("WindowsAuthPassword")))
r.Credentials = myCache

Dim resp As System.Net.HttpWebResponse = r.GetResponse()
Dim sr As New System.IO.StreamReader(resp.GetResponseStream())
Dim html As String = sr.ReadToEnd()
sr.Close()

SEO

In order to improve SEO on the site please make sure the search page has been added to the robots.txt on your site and disallowed so search engines do not reach it. There should always be a no index/no follow on the search pages. For improving SEO functionality on the site for popular search terms ask us more about the SEO Booster functionality we offer.

NOTE: By default all major bots requests for SEARCH PAGES are blocked from being served by the hawksearch servers. The idea is to use landing pages for any custom category/brand/custom landing page that needs to be indexed by search engines. However if you have custom requirement where you still need the search page to be served for web crawlers please include the parameter below with the corresponding request to Hawksearch.

Request for Search

<https://dev.hawksearch.net/sites/demo/?keyword=jackets1&hawkoutput=html&hawkrobots=allow>

Request for Landing Page

<https://dev.hawksearch.net/sites/demo/?lpurl=/accessory&hawkoutput=html&hawkrobots=allow>

JavaScript Block

The following JavaScript needs to be installed on every page of your site. The block should look as follows. Please either adjust or add as needed. The enginename is the engine ID associated with your Hawksearch account. The ClientGuid is the Tracking Key associated with your account.

📘

Note

To lookup the Engine Name and Tracking Key for your account please look in the Hawksearch workbench under Admin >> Account Info.

<!-- Hawksearch Header Includes -->
<script type="text/javascript">
    //<![CDATA[
    (function (HawkSearch, undefined) {
      HawkSearch.HawkUrl = 'http://dev.hawksearch.net/sites/enginename';
      HawkSearch.TrackingUrl = 'http://tracking-dev.hawksearch.net';
      HawkSearch.RecommenderUrl = 'http://recs-dev.hawksearch.net';
      HawkSearch.ClientGuid = 'tracking_key'; 
      if ("https:" == document.location.protocol) {
      HawkSearch.HawkUrl = HawkSearch.HawkUrl.replace("http://", "https://");
      HawkSearch.TrackingUrl = HawkSearch.TrackingUrl.replace("http://", "https://");
      HawkSearch.RecommenderUrl = HawkSearch.RecommenderUrl.replace("http://", "https://");
        }
    }(window.HawkSearch = window.HawkSearch || {}));
      var hawkJSScriptDoc = document.createElement("script");
      hawkJSScriptDoc.async = true;
      hawkJSScriptDoc.src = HawkSearch.HawkUrl + '/includes/hawksearch.min.js?v1.0';
      var hawkJSTag = document.getElementsByTagName('script')[0];
      hawkJSTag.parentNode.insertBefore(hawkJSScriptDoc, hawkJSTag);
      var hawkCSSScriptDoc = document.createElement("link");
      hawkCSSScriptDoc.setAttribute("rel", "stylesheet");
      hawkCSSScriptDoc.setAttribute("type", "text/css");
      hawkCSSScriptDoc.setAttribute("href", HawkSearch.HawkUrl + '/includes/hawksearch.css');
      document.head.appendChild(hawkCSSScriptDoc);

    //]]>
</script>

Autocomplete for Search Results

Within the Hawksearch Workbench, settings can be modified to control what shows in the Auto-Complete section.

To enable it on your page, there are two steps:

Add the Auto-Complete JavaScript block to the end of the tag.

textboxname is the ID of the search text box. Look to your existing HTML code to add the matching ID.

textboxnamefooter is the ID of the search text box if you have one on the footer. Look to your existing HTML code to add the matching ID.

   <!-- Hawksearch - Auto-Suggest -->
    <script type="text/javascript">
        //<![CDATA[
        HawkSearch.initAutoSuggest = function () {
            HawkSearch.suggestInit('%%textboxname%%', {
                lookupUrlPrefix: HawkSearch.HawkUrl + '/?fn=ajax&f=GetSuggestions',
                hiddenDivName: '',
                isAutoWidth: true
            });
            HawkSearch.suggestInit('%%textboxnamefooter%%', {
                lookupUrlPrefix: HawkSearch.HawkUrl + '/?fn=ajax&f=GetSuggestions',
                hiddenDivName: '',
                isAbove: true
            });
        };
        //]]>
    </script>

Autocomplete Integration:

The autocomplete feature can be integrated through API similar to the search functionality. Hawksearch sends the response in JSON format which can be consumed by your website and displayed appropriately.

Request: GET request made through a URL built as follows:

https://DOMAIN_URL/ENGINE_NAME/?fn=ajax&f=GetSuggestions&q=KEYWORD&hawkoutput=json

ParameterDescriptionValue3
fnIndicates ajax requestajax
fThe function name to be calledGetSuggestions
qThe keyword. This is the text typed by the useruser-entered alphanumeric value
hawkoutputIndicates the format of the responsejson

Response: Response is a JSON object sent back to the caller.

Example: Response for GET https://lusearchapi-na.hawksearch.com/sites/demo/?fn=ajax&f=GetSuggestions&q=coat&hawkoutput=json

{
	"Count": 71,
	"ContentCount": 0,
	"PopularHeading": "Popular Searches",
	"CategoryHeading": "Top Product Categories",
	"ProductHeading": "Top 3 Product Matches",
	"ContentHeading": "Top Content Match",
	"Categories": [{
			"Value": "Women &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_6"
		},
		{
			"Value": "Summer Sale &raquo; Women &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_7"
		},
		{
			"Value": "Men &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_4"
		},
		{
			"Value": "Kids &raquo; Girls 5-20 &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_2"
		}
	],
	"Products": [{
			"ProductName": "Women's Mighty Power Hybrid Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Mighty-Power-Hybrid-Jacket-White-Heather-Zinc.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_172279",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Mighty-Power-Hybrid-Jacket-White-Heather-Zinc.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Mighty Power Hybrid Jacket</h1>",
			"Custom": null
		},
		{
			"ProductName": "Women's Whirlibird Interchange Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/842215260AC.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_107149",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/842215260AC.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Whirlibird Interchange Jacket</h1>",
			"Custom": null
		},
		{
			"ProductName": "Women's Trabagon Rain Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Trabagon-Rain-Jacket-Watermelon.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_119547",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Trabagon-Rain-Jacket-Watermelon.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Trabagon Rain Jacket</h1>",
			"Custom": null
		}
	],
	"Content": [],
	"Popular": [{
			"Value": "<b>jackets</b>",
			"Url": "https://demo.hawksearch.com?keyword=jackets"
		},
		{
			"Value": "<b>coat</b>",
			"Url": "https://demo.hawksearch.com?keyword=coat"
		},
		{
			"Value": "<b>columbia </b><b>jacket</b>",
			"Url": "https://demo.hawksearch.com?keyword=columbia%20jacket"
		}
	],
	"SearchWebsiteUrl": "https://demo.hawksearch.com",
	"TrackingVersion": "v2",
	"KeywordField": "keyword",
	"ViewAllButtonLabel": "View All"
}
ParameterDataTypeDetails
CountNumericTotal products available for the keyword
ContentCountNumericTotal content items available for the keyword
CategoriesArray of Category ObjectsEvery category object is a category suggestion:
Value - Name of the category
Url - navigation url
ProductsArray of Product
Objects
Based on the request parameter DisplayFullResponse, the product object has all its fields output or the standard autocomplete format
ContentArray of Content Item ObjectsArray of content item objects with Value and url properties.
PopularArray of Popular Searches
Objects
Every popular search term object is an object with these two properties:
Value - Name of the category
Url - navigation url
SearchWebsiteUrlUrlBase website url for clickable links.
Appended to the Urls present in other object arrays.
TrackingVersionAlphanumeric text of size 2v1 or v2 based on your engine version
KeywordFieldAlphabeticParameter used to denote the keyword field
CategoryHeadingAlphanumericHeader text for Categories
ContentHeadingAlphanumericHeader text for Content Items
ProductHeadingAlphanumericHeader text for Products
PopularHeadingAlphanumericHeader text for Popular Searches
ViewAllButtonLabelAlphanumericHeader text for “View All” link

Example URLs for various environments as follows:

EnvironmentEnvironment URL
Devhttps://dev.hawksearch.net/sites/demo/?fn=ajax&f=GetSuggestions&q=coat&hawkoutput=json
Testhttps://test.hawksearch.net/sites/demo/?fn=ajax&f=GetSuggestions&q=coat&hawkoutput=json
Productionhttps://api.hawksearch.info/sites/demo/?fn=ajax&f=GetSuggestions&q=coat&hawkoutput=json

Note: if you have been provided with a custom domain such as yoursite.hawksearch.com, please replace lusearchapi-na.hawksearch.com in the above url with your custom domain URL.

HTTP/Keep-Alive

In the event that you see unexpected timeout errors from the site when testing, please confirm your http web request settings for the request you make to hawksearch. In some cases, the clients reset the connection instead of leaving it in Time_Wait/Close_Wait causing IIS to log it as an interruption. In this scenario please force the request to be Http 1.0 with no keep alive and see if timeouts no longer appear.

Event Tracking Code

📘

Note

In order to populate data in the Hawksearch Reports, and to leverage Personalized Search, it is CRITICAL to implement Tracking Integration.

Click here for instructions on adding Hawksearch Event Tracking Code .