API Reference
The dictionary server exposes a REST API under the /v1 prefix. A live instance is available at https://api.freedictionary.cn/.
GET /v1/wiktionary/{edition}/words/{word}
Returns the Wiktionary entries for the given word from the designated edition.
Path Parameters
edition: the code of the Wiktionary edition, e.g.enorzh. A route is registered for everyWiktionaryData_*table found in the database; requesting an edition that is not supported returns404 Not Found.
Query Parameters
Both parameters are optional and narrow the search when provided:
| Parameter | Description |
|---|---|
lang_code | The language code of the word, e.g. en. |
lang | The localised language name of the word, e.g. 汉语. |
If both are provided, both are applied as filters.
Examples
GET /v1/wiktionary/en/words/hello?lang_code=en— English-edition Wiktionary entry for the English word “hello”.GET /v1/wiktionary/en/words/hallo?lang_code=de— English-edition Wiktionary entry for the German word “hallo”.GET /v1/wiktionary/zh/words/你好?lang_code=zh— Chinese-edition Wiktionary entry for the Chinese word “你好”.
Response
200 OK: a JSON array of entries for the word; an empty array means the word was not found in that Wiktionary. Each entry is the wrapped word-data object produced by thewiktionary-schemacrate: the word data itself (seeen::WordDataandzh::WordData) plus asourceobject carrying provenance information —url(the Wiktionary page the data came from) andlicense, itself an object withnameandurl(defaults toCC BY-SA 4.0).
Error Responses
Error responses are JSON objects with the following shape:
{
"status": 404,
"message": "Unimplemented wiktionary edition: fr"
}
| Field | Type | Description |
|---|---|---|
status | u16 | The HTTP status code of the error. |
message | String | A human-readable error message. |
| Status | Meaning |
|---|---|
404 Not Found | The requested edition is not supported. |
500 Internal Server Error | Stored data could not be decoded, or an unexpected database/server error occurred. |
503 Service Unavailable | The database is temporarily unreachable; retrying the request may succeed. |
GET /v1/wiktionary/editions
Returns a JSON array of all supported Wiktionary edition codes discovered in the database (e.g. ["en", "zh"]).
Response
200 OK: a JSON array of edition code strings.
GET /v1/wiktionary/{edition}/words
Fuzzy word search. Returns a list of headwords matching the given pattern (e.g. som* matches “some”, “somebody”, “something”).
Note: This endpoint is reserved and not yet implemented. It currently returns
501 Not Implemented.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
q | yes | The search pattern. Use * as a wildcard suffix for prefix matching (e.g. q=som*). |
lang_code | no | Language code filter. |
lang | no | Localised language name filter. |
limit | no | Maximum number of results to return. |
offset | no | Number of results to skip (for pagination). |
Response (Planned)
200 OK: a JSON array of matching headword strings.501 Not Implemented: the endpoint is not yet available.