Search
Search across all available dictionaries. Results are ranked with exact matches first, then prefix matches, then substring matches.
GET /api/v1/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | The search query string. |
lang | string | No | Filter by language. Use an ISO 639-1 code (e.g., en, fr) or a language pair (e.g., en-fr). |
source | string | No | Filter by a specific dictionary ID. Use the dictionaryId value from search results. |
matchType | string | No | Match strategy. One of: exact, prefix (default), contains. |
limit | integer | No | Max results to return. Default: 20, Max: 100. |
offset | integer | No | Number of results to skip for pagination. Default: 0. |
Match Types
Prefix Match (prefix) — Default
Returns results where the word starts with the query. Example: q=bat matches "bat", "batter", "battery".
Exact Match (exact)
Only returns results where the word exactly matches the query. Example: q=bat matches "bat" but not "batter".
Contains Match (contains)
Returns results where the word contains the query anywhere. Example: q=bat matches "bat", "combat", "acrobat".
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.shobdo.me/api/v1/search?q=hello&lang=en&limit=5"Example Response
{
"ok": true,
"data": [
{
"id": "42",
"word": "hello",
"preview": "Used as a greeting or to begin a phone conversation.",
"sourceLang": "en",
"targetLang": null,
"dictionaryId": "...",
"dictionaryName": "...",
"partOfSpeech": "exclamation",
"phonetic": "/həˈləʊ/",
"hasAudio": true
}
],
"meta": {
"total": 12,
"limit": 5,
"offset": 0,
"took_ms": 38
}
}Result Object
| Field | Type | Description |
|---|---|---|
id | string | Unique entry identifier. Use with the Entry endpoint. |
word | string | The matched headword. |
preview | string | A short text preview of the definition. |
sourceLang | string | ISO 639-1 source language code. |
targetLang | string | null | ISO 639-1 target language code (null for monolingual). |
dictionaryId | string | The dictionary this result came from. |
dictionaryName | string | Human-readable dictionary name. |
partOfSpeech | string | undefined | Part of speech (noun, verb, etc.). |
phonetic | string | undefined | IPA pronunciation. |
hasAudio | boolean | Whether this entry has a pronunciation audio clip. |