The Lexicala Web API is a RESTful API that provides lexical data of K Dictionaries originating from lexicographical resources covering 50 languages, and including monolingual cores as well as numerous bilingual pairs and multilingual combinations. The API returns data as JSON documents.

GETTING STARTED

Endpoint
The API endpoint is located at https://lexicala1.p.rapidapi.com.

You can test that the API is upwith GET /test:

https://lexicala1.p.rapidapi.com/test

 

Authentication
To access the API, you need to authenticate your user.
Lexicala API uses Basic Authentication – your credentials are the username and password you used for registration.
To obtain access, pass those as a header, or as parameters in an HTTP client.

ACCOUNT AND ACCESS

User Account

You can view your user account settings with GET /users/me:

https://lexicala1.p.rapidapi.com/users/me

This includes the personal details such as your name and the email you have provided upon registration, your request cap, and the number of requests used in the last 24 hours.

 

Access and Caps
The API results are paginated – each result JSON contains the fields n_results, page_number, results_per_page, n_pages and available_n_pages, with corresponding number values.
The maximum number of results per search query (n_results) is limited to 10,000, with up to 30 entries per page.

The following parameters are used for navigating between pages, and modifying the number of results per page:

  • page (number) – specify the page number out of available_n_pages, in order to navigate between pages.
    the default value is 1.
  • page-length (number) – specify how many results appear per page.
    the default value is 10, and the maximum value is 30.
  • sample (number) – specify the number of randomly-sampled results to return.

LANGUAGES AND DATA

Information about languages available through the API can be obtained with GET /languages, including the full names corresponding to language codes, and the languages available in the various resources:

 

https://lexicala1.p.rapidapi.com/languages

 

By default, results are from KD’s Global series. Data from the Password Series and from Random House Webster’s College Dictionary are also available. The Global series includes 24 monolingual cores (see list below), which are added translation equivalents, producing multilingual versions. The Password series consists of an English core, translated to 46 languages. The Random House Webster’s College Dictionary is an extensive monolingual English dictionary. You can find more information about the different resources on our website.

 

The following is a list of all available source languages (monolingual core), and the available target languages for each resource.

 

Source languageTarget languages in GlobalTarget languages in Password
Arabic (ar)de 
simplified Chinese (zh)en, fr, ja 
traditional Chinese (tw)  
Czech (cs)  
Danish (dk)de, en, es, fr, ko 
Dutch (nl)de, en, es, fr 
English (en)br, dk, es, fr, ja, no, svaf, ar, az, bg, br, ca, cs, de, dk, el, es, et, fa, fi, fr, fy, he, hi, hr, hu, is, it, ja, ko, lt, lv, ml ,nl, no, pl, prs, ps, pt, ro, ru, sk, sl, sr, sv, th, tr, tw, uk, ur, vi, zh
French (fr)ar, br, de, dk, el, en, es, he, it, ja, nl, no, pl, pt, ru, sv, tr 
German (de)ar, br, dk, en, ja, nl, no, sv, tr 
Greek (el)fr 
Hebrew (he)fr 
Hindi (hi)  
Italian (it)br, en, ja, no 
Japanese (ja)de, en, es, fr, zh 
Korean (ko)ja 
Latin (la)fr 
Norwegian (no)de, en, es, fr, it, pl 
Polish (pl)en, fr, no 
Portuguese (pt)fr 
Brazilian Portuguese (br)de, en, es, fr, it 
Russian (ru)fr, ja 
Spanish (es)br, dk, en, ja, nl, no, sv 
Swedish (sv)de, en, es, fr 
Thai (th)  
Turkish (tr)de, fr 
 

See below how to specify which resource to look in, when querying the API for a specific language.

GET /search

Search for entries with GET  /search. A basic API search result consists of a JSON object containing partial lexical information on entries that match the search criteria. To obtain further, more in-depth information for each entry, see GET /entries below.

The entries are returned as objects within the results array, and contain the following fields:

  • the unique entry ID
  • the source language code
  • the headword text
  • part of speech
  • the different senses with their unique sense ID and definition

Basic search parameters include:

  • source ( = global, password, random) – specify which resource to look in.
    the default value is global (the Global series).
  • language ( = en, fr, es, de, pl, …) – specify which source language to look in.
  • text – specify a headword.

For example,
https://lexicala1.p.rapidapi.com/search?source=global&language=es&text=azul

This query returns all entries in the Spanish core of the Global series with the headword “azul”.

It is possible to look for headwords with specific syntactic criteria:

  • pos ( = noun, verb, …) – specify part of speech.
  • number ( = singular, plural, …) – specify grammatical number.
  • gender ( = masculine, feminine, …) – specify grammatical gender.
  • subcategorization ( = masculine, feminine, …) – specify subcategorization.
  • monosemous (boolean) – find single sense entries only.
    polysemous (boolean) – find multiple sense entries only.

For example,
https://lexicala1.p.rapidapi.com/search?source=global&language=pl&pos=noun&number=plural

This query returns all entries in the Polish dictionary of the Global series that are plural nouns.

The API also includes two functionalities pertaining to inflected forms and word stems:

  • morph (boolean) – searches for the text in both headwords and inflections, including in our supplemental morphological lists. This is based on existing human-curated data and semi-automatic morphological lists.
  • analyzed (boolean) – a stemmer algorithm that strips words to their stem, and disregards diacritics and case (uppercase/lowercase).

 

The morph parameter

setting morph = true looks for all inflected forms (as well as headwords) contained both in KD data and in the external morphological lists.

For example,
https://lexicala1.p.rapidapi.com/search?source=global&language=en&text=houses&morph=true

searching “houses” will return the entry “house” (noun) even though the word “houses” is not an entry in the English dictionary (it is a plural inflection of “house”).

The analyzed parameter

setting analyzed = true looks for inflected forms by applying the stemmer.

For example,
https://lexicala1.p.rapidapi.com/search?source=global&language=en&text=working&analyzed=true

This query returns the entries “working” (adj.), “work” (verb), “work” (noun), “hard-working” (adjective), “working class” (noun), “work on” (verb) and any other entry with the stem “work” in its headword.

The stemmer also disregards diacritics and vocalization (for example in Hebrew and Arabic) and removes case-sensitivity (uppercase/lowercase).

 

GET /search-entries

Identical to /search but returns full entries rather than abridged versions.

 

GET /entries, GET /senses – searching by entry (or sense) ID

When searching by parameters (as shown previously), each entry result contains a unique entry ID, and each sense of an entry has its own unique sense ID. Using these IDs, it is possible to obtain more data – various syntactic and semantic information, compositional phrases, usage examples, translations and more – of a single entry (or sense). The entries collection groups together all entries from all different resources (Global, Password, Random House).

The result JSON object contains the field id, source, language, version, related_entries, headword and senses. Following is a brief explanation regarding each field.

  • id (string) – the unique dictionary entry ID
  • source (string) – the K Dictionaries resource from which the entry is taken (Global, Password, Random House)
  • language (string) – a two-character string that is the language code (for a list of all language codes, query GET/languages)
  • version (number) – the version of the dictionary the entry is taken from
  • related entries (array of strings) – an array containing the IDs of the related entries
  • headword (object/array of objects) – contains extensive syntactic and phonetic information of the headword
  • senses (array of objects) – contains an elaborate disambiguation of the headword into senses, including syntactic, phonetic and semantic information

some examples:
https://lexicala1.p.rapidapi.com/entries/EN_DE00000789

The query above returns the complete entry “bank” in the Spanish core of the Global series.

https://lexicala1.p.rapidapi.com/entries/PW00003877

The query above returns the complete entry “chair” in the Password series.

https://lexicala1.p.rapidapi.com/entries/RDE00064769_0

The query above returns the complete entry “smile” in the Random House Webster’s college dictionary.

you can also search for a specific sense by its unique sense ID:

https://lexicala1.p.rapidapi.com/senses/EN_SE00001278

The query above returns the second sense of the polysemous entry “bank”. The JSON result for this type of query includes: id (sense id), source, language and entry (entry id). 

 

STRUCTURE

Following is a detailed schema of the different elements constituting a complete entry JSON object, divided by type. Note that some elements can be of more than one type.

 

Headword Object
Strings: text, pos, subcategorization, gender, case, register, number, geographical_usage, mood, tense
Numbers: homograph_number
Arrays: tense, mood, geographical_usage, register, case, subcategorization (arrays of strings), inflections (array of objects)
Objects: alternative_scripts, pronunciation

 

Sense Object (within the Senses array)
Strings: id, definition, semantic _category, register, range_of_application, subcategorization, geographical_usage, semantic_subcategory, sentiment, see, see_also
Arrays: semantic_category, register, sentiment, geographical_usage, range_of_application, subcategorization, synonyms, antonyms, semantic_subcategory, see_also (arrays of strings), examples, compositional_phrases, inflections, senses (array of objects)
Objects: translations

 

Compositional Phrases Object (within the Compositional Phrases array)
Strings: text, definition, sentiment, register, semantic_category, semantic_subcategory, range_of_application, aspect, pos, geographical_usage
Arrays: synonyms, antonyms, senses, sentiment, register, semantic_category, semantic_subcategory, range_of_application, geographical_usage (arrays of strings), examples (array of objects)
Objects: alternative_scripts, translations

 

Examples Object (within the Examples array)
Strings: text
Objects: alternative_scripts, translations

 

Translations Object

field = language code (2 letters) – value is an object (or an array of objects for more than one translation) with the following fields:

Strings: text, range_of_application, collocate, register, semantic_category, semantic_subcategory, sentiment, gender, number, geographical_usage, pos
Arrays: range_of_application, collocate, register, semantic_category, semantic_subcategory, sentiment, geographical_usage (arrays of strings), inflections, pronunciation (array of objects)
Objects: alternative_scripts, pronunciation

 

Inflections Object (within the Inflections array)
Strings: text, geographical_usage, case, number, gender, register, tense, aspect, subcategorization, mood
Arrays: geographical_usage, case, register, tense, subcategorization, mood (arrays of strings), pronunciation (array of objects)
Objects: alternative_scripts, pronunciation

 

Pronunciation Object
fields: value (string) – the pronunciation text, geographical_usage (string/array of strings)

 

Alternative Scripts Object
field: the name of the alternative script with a string value containing the text

 

FULL DOCUMENTATION

See the Swagger documentation for a comprehensive list of API calls.