公共 API v1
只读词典 API 的参考文档,由服务器发布的 OpenAPI 文档生成——SDK 也是基于同一份契约构建的。
Read-only dictionary API under /api/v1 (contract version 1): no authentication, every answer in a { data, meta } envelope, errors as { statusCode, message, error: true }, X-API-Version on every response. Successful GET answers carry ETag, Last-Modified and Cache-Control. Documentation: https://vocab-bloom-hub.com/en/docs/api.
基础 URLhttps://<instance>/api/v1每个实例都在自己的源下提供 API;下面的示例使用占位符。
契约OpenAPI 3 文档,每个实例都在此路径提供
/api/v1/openapi.json;
已提交的文件 端点
GET/api/v1/openapi.json
The OpenAPI 3 document of the public API (this contract)
参数
无参数。
响应
- 200OK —
object - 429Rate limit of the public prefix exceeded (PUBLIC_API_RATE_LIMIT); retry after the window —
PublicApiErrorT - 503Not available: the OpenAPI document is not ready, or the suggestion queue is full —
PublicApiErrorT
示例
curl 'https://your-instance.example/api/v1/openapi.json'
GET/api/v1/search
Search dictionary entries (flat list, no meanings)
Tiers in relevance order: exact, phrasal, starts-with, phrases, ends-with, contains. When none matches, a trigram similarity tier answers typos (`meta.fuzzy: true`, `similarity` on every item; Postgres instances only). A term shorter than 3 characters searches the exact and prefix tiers only (`meta.short_term: true`). Cacheable: the answer carries `ETag`, `Last-Modified` and `Cache-Control` like every public GET.
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
search | query | string | 是 | The term to search for |
type | query | stringwordgrammar_patternphrase
| 否 | Restrict the answer to one entry type |
limit | query | integer | 否 | 默认值: 10 |
响应
- 200OK —
PublicSearchV1ResT - 400Invalid input: an unknown field, a value outside the allowed set, or a foreign cursor —
PublicApiErrorT - 429Rate limit of the public prefix exceeded (PUBLIC_API_RATE_LIMIT); retry after the window —
PublicApiErrorT
示例
curl 'https://your-instance.example/api/v1/search'
在演练场中试用
GET/api/v1/search/detailed
Search dictionary entries with pagination, meanings and translations
The detailed search: the same term and tiers, paged, with meanings and translations joined on request; the fields travel in the query string (`translation_languages` as a repeated key). Cacheable like every public GET.
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
search | query | string | 是 | The term to search for |
type | query | stringwordgrammar_patternphrase
| 否 | Restrict the answer to one entry type |
limit | query | integer | 否 | 默认值: 10 |
page | query | integer | 否 | 默认值: 1 |
with_meanings | query | boolean | 否 | Join the meanings (with translations, synonyms, antonyms) of every item 默认值: false |
with_translations | query | boolean | 否 | Join the short translations of every item 默认值: false |
translation_languages | query | string[]ruesfrdeptzhar
| 否 | Keep only these translation languages (a repeated key); omit the key for all of them |
响应
示例
curl 'https://your-instance.example/api/v1/search/detailed'
在演练场中试用
GET/api/v1/words/{word}
All entries of a headword: parts of speech, forms, meanings, translations, links
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
word | path | string | 是 | Headword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry |
响应
示例
curl 'https://your-instance.example/api/v1/words/run'
在演练场中试用
GET/api/v1/words/{word}/meanings
The meanings of a headword across its entries
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
word | path | string | 是 | Headword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry |
响应
示例
curl 'https://your-instance.example/api/v1/words/run/meanings'
在演练场中试用
GET/api/v1/words/{word}/translations
The short and per-meaning translations of a headword
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
word | path | string | 是 | Headword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry |
language | query | string[]ruesfrdeptzhar
| 否 | Translation languages; no value means all of them |
响应
示例
curl 'https://your-instance.example/api/v1/words/run/translations'
在演练场中试用
GET/api/v1/words/{word}/synonyms
The synonyms of a headword, per meaning
One item per linked headword and meaning; each names its `meaning_id`, `word_id` and `part_of_speech`.
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
word | path | string | 是 | Headword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry |
响应
示例
curl 'https://your-instance.example/api/v1/words/run/synonyms'
在演练场中试用
GET/api/v1/words/{word}/antonyms
The antonyms of a headword, per meaning
One item per linked headword and meaning; each names its `meaning_id`, `word_id` and `part_of_speech`.
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
word | path | string | 是 | Headword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry |
响应
示例
curl 'https://your-instance.example/api/v1/words/run/antonyms'
在演练场中试用
GET/api/v1/words/id/{id}
One dictionary entry by its numeric id
参数
响应
示例
curl 'https://your-instance.example/api/v1/words/id/1'
在演练场中试用
GET/api/v1/words
List dictionary entries by filters, cursor-paged and ordered by (word, id)
Every enum filter accepts a repeated key; values of one filter are OR-ed, filters are AND-ed. `search` keeps the headwords starting with the prefix (an autocomplete or an A–Z browser: cacheable, unlike the search). Pass `meta.next_cursor` back as `cursor` to read the next page.
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
search | query | string | 否 | Headword prefix, case-insensitive (`ru` lists run, rung, runner, …) |
is_obsolete | query | boolean | 否 | true: obsolete entries only, false: current ones only |
part_of_speech | query | string[]nounverbmodal_verbadjectiveadverbpronounnumeralnumeral_fractionaldeterminerinterjectionarticleprepositionconjunctionletterphrasegrammar_pattern
| 否 | |
word_level | query | string[]A1A2B1B2C1C2
| 否 | |
language_register | query | string[]formalinformalslang
| 否 | |
category | query | string[]scientifictechnicalmedicallegalbusinessITartpoliticalsportculinary
| 否 | Words tagged with any of the categories |
area_variant | query | string[]commonbritishamericanaustralian
| 否 | |
form_of_word | query | string[]base_formplural_formpossessive_singular_formpossessive_plural_formpast_simplepast_participlepresent_participlethird_person_singularcomparative_formsuperlative_formobjectpossessive_adjectivepossessive_pronounreflexiveordinalmultiplicative
| 否 | Defaults to base forms only 默认值: ["base_form"] |
cursor | query | string | 否 | The `meta.next_cursor` of the previous page; omit for the first page |
limit | query | integer | 否 | 默认值: 20 |
with_meanings | query | boolean | 否 | Join the meanings of every word 默认值: false |
with_translations | query | boolean | 否 | Join the short translations of every word 默认值: false |
响应
- 200OK —
PublicWordsV1ResT - 400Invalid input: an unknown field, a value outside the allowed set, or a foreign cursor —
PublicApiErrorT - 429Rate limit of the public prefix exceeded (PUBLIC_API_RATE_LIMIT); retry after the window —
PublicApiErrorT
示例
curl 'https://your-instance.example/api/v1/words'
在演练场中试用
GET/api/v1/random
A random dictionary entry matching the filters (base forms unless form_of_word is given)
参数
| 名称 | 位置 | 类型 | 必填 | 描述 |
|---|
search | query | string | 否 | Headword prefix, case-insensitive (`ru` lists run, rung, runner, …) |
is_obsolete | query | boolean | 否 | true: obsolete entries only, false: current ones only |
part_of_speech | query | string[]nounverbmodal_verbadjectiveadverbpronounnumeralnumeral_fractionaldeterminerinterjectionarticleprepositionconjunctionletterphrasegrammar_pattern
| 否 | |
word_level | query | string[]A1A2B1B2C1C2
| 否 | |
language_register | query | string[]formalinformalslang
| 否 | |
category | query | string[]scientifictechnicalmedicallegalbusinessITartpoliticalsportculinary
| 否 | Words tagged with any of the categories |
area_variant | query | string[]commonbritishamericanaustralian
| 否 | |
form_of_word | query | string[]base_formplural_formpossessive_singular_formpossessive_plural_formpast_simplepast_participlepresent_participlethird_person_singularcomparative_formsuperlative_formobjectpossessive_adjectivepossessive_pronounreflexiveordinalmultiplicative
| 否 | Defaults to base forms only 默认值: ["base_form"] |
响应
示例
curl 'https://your-instance.example/api/v1/random'
在演练场中试用
POST/api/v1/words/batch
Up to 50 headwords in one request
Every spelling is matched like `GET /words/{word}`; the answer keeps the request order, collapses duplicates, and lists the spellings without an entry under `meta.not_found` instead of failing. One request against the rate limit, whatever the size of the batch.
| 名称 | 类型 | 必填 | 描述 |
|---|
words | string[] | 是 | Headword spellings, 50 at most, each matched like GET /words/{word} (case-insensitively; an inflected form resolves to its base entry) |
响应
示例
curl -X POST 'https://your-instance.example/api/v1/words/batch' \
-H 'Content-Type: application/json' \
-d '{"words":["example"]}'在演练场中试用
POST/api/v1/suggestions
Report a mistake in the dictionary data
Files a report for the instance admin to review: what is wrong with a headword (optionally one specific entry of it) and, ideally, what would be right. The headword must exist in the dictionary. Strictly rate-limited; once too many reports are waiting for the admin the endpoint answers 503 until the queue is worked down.
| 名称 | 类型 | 必填 | 描述 |
|---|
headword | string | 是 | The headword the report is about; must exist in the dictionary |
word_id | object | 否 | Id of the entry (part of speech) the report points at, from the word answers |
kind | stringreportedit
| 否 | 默认值: "report" |
message | object | 否 | What is wrong and, ideally, what would be right. Required for a report; an optional comment on an edit |
edits | SuggestionEditV1DTO[] | 否 | Edit flow: every touched target of the word form with its proposed values |
响应
示例
curl -X POST 'https://your-instance.example/api/v1/suggestions' \
-H 'Content-Type: application/json' \
-d '{"headword":"example"}'在演练场中试用
模式
SuggestionEditV1DTO
| 名称 | 类型 | 必填 | 描述 |
|---|
target_type | stringwordmeaningmeaning_translationshort_translation
| 是 | |
target_id | number | 是 | Id of the targeted row, from the word answers |
changes | object | 是 | The proposed field values, e.g. { "definition": "…" }. The accepted fields depend on target_type; unknown fields, empty values and values equal to the current ones are rejected |
CreateSuggestionV1ReqDTO
| 名称 | 类型 | 必填 | 描述 |
|---|
headword | string | 是 | The headword the report is about; must exist in the dictionary |
word_id | object | 否 | Id of the entry (part of speech) the report points at, from the word answers |
kind | stringreportedit
| 否 | 默认值: "report" |
message | object | 否 | What is wrong and, ideally, what would be right. Required for a report; an optional comment on an edit |
edits | SuggestionEditV1DTO[] | 否 | Edit flow: every touched target of the word form with its proposed values |
WordsBatchV1ReqDTO
| 名称 | 类型 | 必填 | 描述 |
|---|
words | string[] | 是 | Headword spellings, 50 at most, each matched like GET /words/{word} (case-insensitively; an inflected form resolves to its base entry) |
EnPartOfSpeechE
取值之一: noun, verb, modal_verb, adjective, adverb, pronoun, numeral, numeral_fractional, determiner, interjection, article, preposition, conjunction, letter, phrase, grammar_pattern
WordLevelE
取值之一: A1, A2, B1, B2, C1, C2
EnAreaVariantsE
取值之一: common, british, american, australian
CategoryE
取值之一: scientific, technical, medical, legal, business, IT, art, political, sport, culinary
LanguageRegisterE
取值之一: formal, informal, slang
EnVerbTransitivityE
取值之一: transitive, intransitive, both
EnPhrasalObjectPatternE
取值之一: no_object, inseparable, separable, separable_pronoun_only
PublicSearchDetailedV1ResT
PublicWordV1MeaningTranslationT
AvailableTranslationLanguagesE
取值之一: ru, es, fr, de, pt, zh, ar
PublicWordV1ShortTranslationT
PublicHeadwordMeaningsV1ResT
PublicShortTranslationV1T
PublicMeaningTranslationV1T
PublicWordLinkV1T
| 名称 | 类型 | 必填 | 描述 |
|---|
meaning_id | integer | 是 | |
word | string | 是 | |
word_id | integer | 是 | |
part_of_speech | EnPartOfSpeechE | 是 | |
PublicHeadwordLinksV1ResT
PublicHeadwordTranslationsV1T
PublicHeadwordTranslationsV1ResT
PublicDatasetCountsV1T
| 名称 | 类型 | 必填 | 描述 |
|---|
entries | integer | 是 | |
words | integer | 是 | |
phrases | integer | 是 | |
grammar_patterns | integer | 是 | |
word_forms | integer | 是 | |
meanings | integer | 是 | |
meaning_translations | integer | 是 | |
short_translations | integer | 是 | |
PublicAvailableLanguagesV1T
PublicSuggestionCreatedV1T
| 名称 | 类型 | 必填 | 描述 |
|---|
id | integer | 是 | |
status | string | 是 | |
PublicSuggestionCreatedV1ResT
PublicApiErrorT
| 名称 | 类型 | 必填 | 描述 |
|---|
statusCode | number | 是 | |
message | string | 是 | |
error | boolean | 是 | |