Vocab Bloom Hub

公共 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/meta

API and dataset versions, data license and counts of the served dictionary

参数

无参数。

响应

示例

curl 'https://your-instance.example/api/v1/meta'

在演练场中试用

GET/api/v1/openapi.json

The OpenAPI 3 document of the public API (this contract)

参数

无参数。

响应

  • 200OKobject
  • 429Rate limit of the public prefix exceeded (PUBLIC_API_RATE_LIMIT); retry after the windowPublicApiErrorT
  • 503Not available: the OpenAPI document is not ready, or the suggestion queue is fullPublicApiErrorT

示例

curl 'https://your-instance.example/api/v1/openapi.json'

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.

参数

名称位置类型必填描述
searchquerystringThe term to search for
typequerystring
wordgrammar_patternphrase
Restrict the answer to one entry type
limitqueryinteger
默认值: 10
pagequeryinteger
默认值: 1
with_meaningsquerybooleanJoin the meanings (with translations, synonyms, antonyms) of every item
默认值: false
with_translationsquerybooleanJoin the short translations of every item
默认值: false
translation_languagesquerystring[]
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

参数

名称位置类型必填描述
wordpathstringHeadword 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

参数

名称位置类型必填描述
wordpathstringHeadword 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

参数

名称位置类型必填描述
wordpathstringHeadword spelling, case-insensitive (spaces URL-encoded for phrases). An inflected form resolves to its base entry
languagequerystring[]
ruesfrdeptzhar
Translation languages; no value means all of them

响应

示例

curl 'https://your-instance.example/api/v1/words/run/translations'

在演练场中试用

GET/api/v1/words/{word}/forms

The inflected forms of a headword across its entries

参数

名称位置类型必填描述
wordpathstringHeadword 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/forms'

在演练场中试用

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`.

参数

名称位置类型必填描述
wordpathstringHeadword 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`.

参数

名称位置类型必填描述
wordpathstringHeadword 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

参数

名称位置类型必填描述
idpathnumber

响应

示例

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.

参数

名称位置类型必填描述
searchquerystringHeadword prefix, case-insensitive (`ru` lists run, rung, runner, …)
is_obsoletequerybooleantrue: obsolete entries only, false: current ones only
part_of_speechquerystring[]
nounverbmodal_verbadjectiveadverbpronounnumeralnumeral_fractionaldeterminerinterjectionarticleprepositionconjunctionletterphrasegrammar_pattern
word_levelquerystring[]
A1A2B1B2C1C2
language_registerquerystring[]
formalinformalslang
categoryquerystring[]
scientifictechnicalmedicallegalbusinessITartpoliticalsportculinary
Words tagged with any of the categories
area_variantquerystring[]
commonbritishamericanaustralian
form_of_wordquerystring[]
base_formplural_formpossessive_singular_formpossessive_plural_formpast_simplepast_participlepresent_participlethird_person_singularcomparative_formsuperlative_formobjectpossessive_adjectivepossessive_pronounreflexiveordinalmultiplicative
Defaults to base forms only
默认值: ["base_form"]
cursorquerystringThe `meta.next_cursor` of the previous page; omit for the first page
limitqueryinteger
默认值: 20
with_meaningsquerybooleanJoin the meanings of every word
默认值: false
with_translationsquerybooleanJoin the short translations of every word
默认值: false

响应

  • 200OKPublicWordsV1ResT
  • 400Invalid input: an unknown field, a value outside the allowed set, or a foreign cursorPublicApiErrorT
  • 429Rate limit of the public prefix exceeded (PUBLIC_API_RATE_LIMIT); retry after the windowPublicApiErrorT

示例

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)

参数

名称位置类型必填描述
searchquerystringHeadword prefix, case-insensitive (`ru` lists run, rung, runner, …)
is_obsoletequerybooleantrue: obsolete entries only, false: current ones only
part_of_speechquerystring[]
nounverbmodal_verbadjectiveadverbpronounnumeralnumeral_fractionaldeterminerinterjectionarticleprepositionconjunctionletterphrasegrammar_pattern
word_levelquerystring[]
A1A2B1B2C1C2
language_registerquerystring[]
formalinformalslang
categoryquerystring[]
scientifictechnicalmedicallegalbusinessITartpoliticalsportculinary
Words tagged with any of the categories
area_variantquerystring[]
commonbritishamericanaustralian
form_of_wordquerystring[]
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.

请求体 · WordsBatchV1ReqDTO

名称类型必填描述
wordsstring[]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.

请求体 · CreateSuggestionV1ReqDTO

名称类型必填描述
headwordstringThe headword the report is about; must exist in the dictionary
word_idobjectId of the entry (part of speech) the report points at, from the word answers
kindstring
reportedit
默认值: "report"
messageobjectWhat is wrong and, ideally, what would be right. Required for a report; an optional comment on an edit
editsSuggestionEditV1DTO[]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_typestring
wordmeaningmeaning_translationshort_translation
target_idnumberId of the targeted row, from the word answers
changesobjectThe 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

名称类型必填描述
headwordstringThe headword the report is about; must exist in the dictionary
word_idobjectId of the entry (part of speech) the report points at, from the word answers
kindstring
reportedit
默认值: "report"
messageobjectWhat is wrong and, ideally, what would be right. Required for a report; an optional comment on an edit
editsSuggestionEditV1DTO[]Edit flow: every touched target of the word form with its proposed values

WordsBatchV1ReqDTO

名称类型必填描述
wordsstring[]Headword spellings, 50 at most, each matched like GET /words/{word} (case-insensitively; an inflected form resolves to its base entry)

PublicSearchV1MetaT

名称类型必填描述
countinteger
fuzzyboolean
short_termboolean

PublicSearchV1ResT

名称类型必填描述
dataPublicSearchWordV1T[]
metaPublicSearchV1MetaT

PublicSearchWordV1T

名称类型必填描述
idinteger
wordstring
part_of_speechEnPartOfSpeechE
form_of_wordEnWordFormsE
is_obsoleteboolean
is_abbreviationboolean
word_levelWordLevelE | null
area_variantEnAreaVariantsE | null
categoriesCategoryE[]
language_registerLanguageRegisterE | null
descriptionstring | null
transcriptionstring | null
patternstring[] | null
noun___irregular_pluralboolean | null
noun___uncountableboolean | null
noun___is_properboolean | null
noun___always_pluralboolean | null
verb___is_irregularboolean | null
verb___transitivityEnVerbTransitivityE | null
verb___is_phrasalboolean | null
verb___phrasal_object_patternEnPhrasalObjectPatternE | null
base_phrasalstring | null
formsPublicWordV1FormT[]
similaritynumber

EnPartOfSpeechE

取值之一: noun, verb, modal_verb, adjective, adverb, pronoun, numeral, numeral_fractional, determiner, interjection, article, preposition, conjunction, letter, phrase, grammar_pattern

EnWordFormsE

取值之一: base_form, plural_form, possessive_singular_form, possessive_plural_form, past_simple, past_participle, present_participle, third_person_singular, comparative_form, superlative_form, object, possessive_adjective, possessive_pronoun, reflexive, ordinal, multiplicative

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

PublicWordV1FormT

名称类型必填描述
idinteger
wordstring
form_of_wordEnWordFormsE
area_variantEnAreaVariantsE
transcriptionstring | null

PublicSearchDetailedV1MetaT

名称类型必填描述
pageinteger
limitinteger
has_moreboolean
fuzzyboolean
short_termboolean

PublicSearchDetailedV1ResT

名称类型必填描述
dataPublicWordV1T[]
metaPublicSearchDetailedV1MetaT

PublicWordV1T

名称类型必填描述
meaningsPublicWordV1MeaningT[]
short_translationsPublicWordV1ShortTranslationT[]
phrasal_variantsstring[]
idinteger
wordstring
part_of_speechEnPartOfSpeechE
form_of_wordEnWordFormsE
is_obsoleteboolean
is_abbreviationboolean
word_levelWordLevelE | null
area_variantEnAreaVariantsE | null
categoriesCategoryE[]
language_registerLanguageRegisterE | null
descriptionstring | null
transcriptionstring | null
patternstring[] | null
noun___irregular_pluralboolean | null
noun___uncountableboolean | null
noun___is_properboolean | null
noun___always_pluralboolean | null
verb___is_irregularboolean | null
verb___transitivityEnVerbTransitivityE | null
verb___is_phrasalboolean | null
verb___phrasal_object_patternEnPhrasalObjectPatternE | null
base_phrasalstring | null
formsPublicWordV1FormT[]
similaritynumber

PublicWordV1MeaningT

名称类型必填描述
idinteger
sort_orderinteger
titlestring
definitionstring
is_obsoleteboolean
examplesstring[]
categoriesCategoryE[]
meaning_levelWordLevelE | null
area_variantEnAreaVariantsE
language_registerLanguageRegisterE | null
translationsPublicWordV1MeaningTranslationT[]
synonymsstring[]
antonymsstring[]

PublicWordV1MeaningTranslationT

名称类型必填描述
idinteger
languageAvailableTranslationLanguagesE
titlestring
definitionstring
variants_of_wordsstring[]

AvailableTranslationLanguagesE

取值之一: ru, es, fr, de, pt, zh, ar

PublicWordV1ShortTranslationT

名称类型必填描述
idinteger
languageAvailableTranslationLanguagesE
descriptionstring
variants_of_wordsstring[]

PublicWordV1ResT

名称类型必填描述
dataPublicWordV1T

PublicHeadwordV1MetaT

名称类型必填描述
wordstring
countinteger

PublicHeadwordV1ResT

名称类型必填描述
dataPublicWordV1T[]
metaPublicHeadwordV1MetaT

PublicMeaningV1T

名称类型必填描述
word_idinteger
part_of_speechEnPartOfSpeechE
idinteger
sort_orderinteger
titlestring
definitionstring
is_obsoleteboolean
examplesstring[]
categoriesCategoryE[]
meaning_levelWordLevelE | null
area_variantEnAreaVariantsE
language_registerLanguageRegisterE | null
translationsPublicWordV1MeaningTranslationT[]
synonymsstring[]
antonymsstring[]

PublicHeadwordMeaningsV1ResT

名称类型必填描述
dataPublicMeaningV1T[]
metaPublicHeadwordV1MetaT

PublicWordFormV1T

名称类型必填描述
word_idinteger
part_of_speechEnPartOfSpeechE
idinteger
wordstring
form_of_wordEnWordFormsE
area_variantEnAreaVariantsE
transcriptionstring | null

PublicHeadwordFormsV1ResT

名称类型必填描述
dataPublicWordFormV1T[]
metaPublicHeadwordV1MetaT

PublicShortTranslationV1T

名称类型必填描述
word_idinteger
part_of_speechEnPartOfSpeechE
idinteger
languageAvailableTranslationLanguagesE
descriptionstring
variants_of_wordsstring[]

PublicMeaningTranslationV1T

名称类型必填描述
meaning_idinteger
word_idinteger
part_of_speechEnPartOfSpeechE
idinteger
languageAvailableTranslationLanguagesE
titlestring
definitionstring
variants_of_wordsstring[]

PublicWordLinkV1T

名称类型必填描述
meaning_idinteger
wordstring
word_idinteger
part_of_speechEnPartOfSpeechE

PublicHeadwordLinksV1ResT

名称类型必填描述
dataPublicWordLinkV1T[]
metaPublicHeadwordV1MetaT

PublicHeadwordTranslationsV1T

名称类型必填描述
short_translationsPublicShortTranslationV1T[]
meaning_translationsPublicMeaningTranslationV1T[]

PublicHeadwordTranslationsV1ResT

名称类型必填描述
metaPublicHeadwordV1MetaT
dataPublicHeadwordTranslationsV1T

PublicWordsBatchItemV1T

名称类型必填描述
wordstring
countinteger
entriesPublicWordV1T[]

PublicWordsBatchV1MetaT

名称类型必填描述
countinteger
not_foundstring[]

PublicWordsBatchV1ResT

名称类型必填描述
dataPublicWordsBatchItemV1T[]
metaPublicWordsBatchV1MetaT

PublicWordsV1MetaT

名称类型必填描述
limitinteger
has_moreboolean
next_cursorstring | null

PublicWordsV1ResT

名称类型必填描述
dataPublicWordV1T[]
metaPublicWordsV1MetaT

PublicDatasetCountsV1T

名称类型必填描述
entriesinteger
wordsinteger
phrasesinteger
grammar_patternsinteger
word_formsinteger
meaningsinteger
meaning_translationsinteger
short_translationsinteger

PublicMetaV1T

名称类型必填描述
api_versionstring
app_versionstring
dataset_versionstring | null
licensestring
license_urlstring
attributionstring
noticestring
countsPublicDatasetCountsV1T
available_languagesPublicAvailableLanguagesV1T

PublicAvailableLanguagesV1T

名称类型必填描述
sourcestring[]
translationsAvailableTranslationLanguagesE[]

PublicMetaV1ResT

名称类型必填描述
dataPublicMetaV1T

PublicSuggestionCreatedV1T

名称类型必填描述
idinteger
statusstring

PublicSuggestionCreatedV1ResT

名称类型必填描述
dataPublicSuggestionCreatedV1T

PublicApiErrorT

名称类型必填描述
statusCodenumber
messagestring
errorboolean