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/autocompleteQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | The search prefix string (e.g., hel). |
lang | string | No | Filter by language. Use an ISO 639-1 code (e.g., en) or a language pair. |
source | string | No | Filter by a specific dictionary ID. |
limit | integer | No | Max 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
}
}