Dictionary

Dictionary Suggestions

0calls
1 credits / call

Want typeahead in your dictionary search box? Users type a few letters and instantly see matching candidates — that is what this endpoint is for.

GET
uapis.cn
/api/v1/dictionary/suggest
Query parameters
2
q
string
required

English prefix to complete, up to 64 characters. The name word also works.

limit
integer

Max number of suggestions. Default 10, maximum 30.

Overview

Pass the prefix the user is typing via q (also accepts word). You get a list of candidate words with short meanings. After the user picks one, call the Word Lookup endpoint for the full entry.

What's Returned

  • query: the prefix that was actually matched.
  • count: how many suggestions came back.
  • suggestions: the list. Each item has word and optional meaning.

Notes

Empty results If nothing matches, the response is still HTTP 200 and suggestions is []. Clear the candidate list on the frontend — do not treat it as an error.

Query parameters

q
stringrequired

English prefix to complete, up to 64 characters. The name word also works.

limit
integeroptional

Max number of suggestions. Default 10, maximum 30.

Response

200 / OK

Success. When nothing matches, suggestions is an empty array.

JSON
{
  "query": "pre",
  "count": 3,
  "suggestions": [
    {
      // Suggested word
      "word": "present",
      // Short meaning; may be missing
      "meaning": "n. the present time; a gift"
    }
  ]
}

400 / Bad Request

Invalid parameters, e.g. empty q, too long, or a bad limit.

502 / Bad Gateway

Service temporarily unavailable. Please try again later.

JSON
{
  "code": "SERVICE_UNAVAILABLE",
  "message": "Service temporarily unavailable. Please try again later."
}