Auto Complete

Completes a word fragment.

The Auto Complete API allows you to expand a prefix into a list of possible words that the prefix matches. You can use this API to provide search suggestions.

Quick Start

The API accepts a single parameter, text, which describes the text that you want to expand.

/1/api/[async|sync]/autocomplete/v1?text=my_text

The API uses an internal dictionary of English words and phrases to expand the prefix text. The dictionary includes names and other common phrases that users might want to search for.

It returns a list of five matching words and phrases.

Example

The following example suggests words and phrases that begin with subl:

/1/api/[async|sync]/autocomplete/v1?text=subl

This is the response:


{
  "words": [
    "sublime",
    "sublimation",
    "sublime with rome",
    "subluxation",
    "subliminal stimuli"
  ]
}
Synchronous
https://api.havenondemand.com/1/api/sync/autocomplete/v1
Asynchronous
https://api.havenondemand.com/1/api/async/autocomplete/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
text
string The text that you want to expand. The API returns a list of words and phrases that this text expands to.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Auto Complete Response {
words ( array[string] , optional) Strings that complete the supplied text.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "words": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "type": "object"
}


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.