Shobdo Logo

Autocomplete

The Autocomplete endpoint provides high-performance, edge-cached suggestions as the user types. It is heavily optimized for prefix matching and alphabetization, returning a simple list of strings.

GET /api/v1/api/autocomplete

Query Parameters

ParameterTypeRequiredDescription
qstringYesThe search prefix string (e.g., hel).
langstringNoFilter by language. Use an ISO 639-1 code (e.g., en) or a language pair.
sourcestringNoFilter by a specific dictionary ID.
limitintegerNoMax results to return. Default: 10, Max: 50.

Example Request

cURL
curl -X GET "https://api.shobdo.me/api/v1/api/autocomplete?q=hel&limit=5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://api.shobdo.me/api/v1/api/autocomplete?q=hel&limit=5", {
  headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await response.json();
Python
import requests
 
response = requests.get(
    "https://api.shobdo.me/api/v1/api/autocomplete",
    params={"q": "hel", "limit": 5},
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()

Example Response

{
  "ok": true,
  "data": [
    "helicopter",
    "heliocentric",
    "helium",
    "helix",
    "hello"
  ],
  "meta": {
    "limit": 5,
    "took_ms": 12
  }
}

Performance

Because it only returns strings (headwords) and not full definitions, this endpoint is significantly faster than the standard /search endpoint and is cached heavily at the edge.

Assistant

Hi! I'm the Shobdo Assistant.
Ask me anything about the documentation.