GetAutocompleteSuggestions input: string Query, int NumberOfResults output: string[] AutocompleteSuggestionsResult
Takes a Querywhich can be a word or the beginning of a word, and returns the topNumberOfResults suggestions for possible word or phrase completions.
These results are ordered by best match descending.
For example, for the query “chi”,
the top 10 results are:
china
chicago
chinese
chile
chicago, illinois
chicago cubs
chicago white sox
chicago bears
chicago tribune
chief justice
Sample code in C#:
PingarAPIRequest request = new PingarAPIRequest();
request.AppID = "your app id";
request.AppKey = "your app key";
request.SearchSupport = new SearchSupportRequest();
request.SearchSupport.Query = "autocomplete term";
request.SearchSupport.NumberOfResults = 5;
request.Language = Language.EN;
PingarAPIServiceSoapClient pingarAPI = new PingarAPIServiceSoapClient();
PingarAPIResponse response = pingarAPI.GetAutocompleteSuggestions(request);
if (response.Error == null)
{
Console.Write("Suggestions for query: ");
foreach (string suggestion in
response.SearchSupport.AutocompleteSuggestionsResult)
{
Console.WriteLine(suggestion);
}
}