Text autocomplete API

autocomplete takes input text and returns possible completions.

Command name: autocomplete Success status: 200 OK

On this page

Related: Overview, Supported languages

Common parameters

cmd selects the command to run.

Name
Type
Required
Description

cmd

string

Yes

Must be autocomplete.

These parameters work with any cmd.

Name
Type
Required
Description

serviceid

string

Cloud only

Cloud API key. Required for Cloud requests. Not used on-premises.

short_answer

boolean

No

JSON only. When true, shortens JSON keys to reduce payload size.

See Overview for details.

Parameters

These are parameters specific to cmd=autocomplete.

Name
Type
Required
Description

text

string

Yes

Text to complete. The completion is returned as a suffix string. It can start with whitespace.

lang

string

Yes

Language code. Use a language where autocomplete is enabled. See Supported languages.

Request examples

Example: completion found

Request:

Response (200 OK):

Use defaults: format=json, short_answer=false.

Example: no suggestions

Request:

Response (200 OK):

Response schema

The response is always an object with a single result.

JSON (short_answer=false)

  • result (object) Always present.

  • result.suggestions (array of strings) May be empty. Each item is a completion suffix to append to text.

Short JSON (short_answer=true)

Key mapping:

  • resultr

  • suggestionss

Errors

Errors use the shared error format from Overview.

Language code not found (400 Bad Request)

Language has no autocomplete support (403 Forbidden)

Last updated

Was this helpful?