Spelling autocorrect API
autocorrect takes a single word and returns one spelling suggestion.
It also returns a localized “revert” message for the UI.
Command name: autocorrect
Success status: 200 OK
On this page
Related: Overview, Supported languages
Common parameters
cmd selects the command to run.
cmd
string
Yes
Must be autocorrect.
These parameters work with any cmd.
serviceid
string
Cloud only
Cloud API key. Required for Cloud requests. Not used on-premises.
format
string
No
Response format. Values: json (default), xml.
callback
string
No
JSONP wrapper function name. Use only with format=json.
short_answer
boolean
No
JSON only. When true, shortens JSON keys to reduce payload size.
See boolean parameters.
See Overview for details.
Parameters
These are parameters specific to cmd=autocorrect.
text
string
Yes
Word to autocorrect. If it contains spaces, the command returns no suggestions.
locale
string
No
Localization for the revert message shown to the user. Accepted formats: es, es-ES, es_ES.
Behavior notes
The response contains zero or one suggestion.
If
texthas more than one word, you get an empty result.An empty result is still a
200 OK.
Request examples
Example: suggestion found
Request:
Response (200 OK):
Use defaults: format=json, short_answer=false.
Add short_answer=true.
Set format=xml.
Example: no suggestions
Request:
Response (200 OK):
Use defaults: format=json, short_answer=false.
Add short_answer=true.
Set format=xml.
Response schema
The response is always an object with a single result.
JSON (short_answer=false)
result(object) Always present. Empty object means “no suggestions”.result.suggestions(array of strings) Zero or one element.result.message(string) Localized label for the revert action. Present when a suggestion exists.
Short JSON (short_answer=true)
Key mapping:
result→rmessage→msuggestions→s
Errors
Errors use the shared error format from Overview.
Language code not found (400 Bad Request)
Language has no spelling support (403 Forbidden)
Last updated
Was this helpful?

