Lexidata API Reference
Lexidata is an open lexical API providing structured access to over 153,000 English lemmas, WordNet synsets, phonetic pronunciations, definitions, and semantic relationships.
https://api.lexidata.devQuickstart in 30 Seconds
You can start querying Lexidata immediately using direct HTTP requests, our official JavaScript client, or Python.
curl -s "https://api.lexidata.dev/api/v1/words/serendipity"// Install: npm install lexidata
import { createClient } from "lexidata";
const lexidata = createClient();
const word = await lexidata.word("serendipity");
console.log(word.senses[0].definition);Core Concepts Demystified
Lexidata models lexical knowledge based on Princeton WordNet and Open English WordNet. Here is what each core term means in plain English:
Lemma (Word)
The base canonical dictionary form of a word. For example, running, ran, and runs map to the base lemma run.
Synset (Synonym Set)
A cluster of words representing one distinct concept or meaning. Each synset has a unique identifier (e.g., 07525381-n) shared by all synonyms of that concept.
Word Sense
Words often have multiple meanings. Each meaning is a sense containing its part of speech, definition, synset ID, and sample usage sentences.
Pronunciation (IPA)
Phonetic transcriptions represented in standard International Phonetic Alphabet (IPA), such as /ˌsɛ.ɹən.ˈdɪ.pɪ.ti/.
Word Lookup
Retrieve all lexical senses, definitions, usage examples, and pronunciations for a specific word. Lookups are case-insensitive.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
:word | string | Yes | The English word or lemma to look up (e.g. serendipity). |
curl -s "https://api.lexidata.dev/api/v1/words/serendipity"Search & Filtering
Search vocabulary using prefix, substring, or exact matching with optional part-of-speech and character length constraints.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | Required | Search term or prefix. |
match | string | prefix | Match mode: prefix, contains, or exact. |
pos / partOfSpeech | string | none | Filter: noun, verb, adjective, adverb. |
limit | integer | 20 | Maximum results to return (1–100). |
page | integer | 1 | Pagination page number. |
minLength / maxLength | integer | none | Constrain word character length. |
curl -s "https://api.lexidata.dev/api/v1/search?q=cogn&match=prefix&limit=5"Random Words
Fetch pseudo-random vocabulary items. Ideal for word games, vocabulary building, flashcards, and machine learning test samples.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 1 | Number of words to generate (1–50). |
pos / partOfSpeech | string | none | Optional filter by part of speech (noun, verb, adjective, adverb). |
Dataset Exports
Generate streamed or downloadable lexical datasets formatted for data science, NLP corpus creation, or bulk system integration.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | json | Export format: json, jsonl, csv, or txt. |
fields | string | meaning | Preset name (basic, meaning, linguistic, all) or comma-separated column names. |
startsWith / endsWith / contains | string | none | Morphological substring filters. |
limit | integer | 50 | Maximum rows to stream (up to 1,000 per request). |
Field Reference & Schema
Reference for all lexical attributes and field projection options available in Lexidata.
stringThe standard lemma representation (e.g. "serendipity").
string[]Grammatical classifications: noun, verb, adjective, or adverb.
string[]Phonetic transcriptions formatted in International Phonetic Alphabet (IPA).
string[]WordNet 8-digit synset offsets with POS suffix (e.g. 07525381-n).
string[]Sense-level explanatory definitions describing the word's meaning.
string[]Contextual sentences illustrating authentic grammatical usage.
object[]Semantic edges including hypernyms, hyponyms, antonyms, and holonyms.
Developer Recipes & Code Patterns
Copy-pasteable code snippets for common production patterns across JavaScript / TypeScript and Python.
Look Up Definitions & Pronunciations
Fetch detailed senses, grammatical parts of speech, IPA phonetic transcriptions, and usage examples.
import { createClient } from "lexidata";
const client = createClient();
async function getWordDetails(term) {
try {
const entry = await client.word(term);
console.log(`Word: ${entry.word}`);
if (entry.pronunciations?.length) {
console.log(`IPA: ${entry.pronunciations.map(p => p.ipa).join(", ")}`);
}
entry.senses.forEach((sense, index) => {
console.log(`[${index + 1}] (${sense.partOfSpeech}) ${sense.definition}`);
sense.examples?.forEach(ex => console.log(` e.g. "${ex}"`));
});
} catch (err) {
if (err.statusCode === 404) {
console.error(`Word "${term}" not found in dictionary.`);
}
}
}
getWordDetails("serendipity");Typeahead / Autocomplete Search
Implement instant prefix-based search for dropdowns, searchbars, or input suggest widgets.
import { createClient } from "lexidata";
const client = createClient();
async function autocompleteWord(prefix) {
const results = await client
.query()
.startsWith(prefix)
.limit(8);
return results.data.map(item => ({
word: item.word,
pos: item.senses?.[0]?.partOfSpeech || "noun",
snippet: item.senses?.[0]?.definition || "",
}));
}
// Example usage:
const suggestions = await autocompleteWord("neur");
console.log(suggestions);Crossword & Word Game Constraints
Filter words by character length, grammatical classification, prefix, or suffix for puzzles and word games.
import { createClient } from "lexidata";
const client = createClient();
// Query 5-letter adjectives starting with 'a'
async function findGameWords() {
const matches = await client
.query()
.startsWith("a")
.partOfSpeech("adjective")
.minLength(5)
.maxLength(5)
.limit(10);
console.log(matches.data.map(w => w.word));
}
findGameWords();Python Integration for NLP & AI
Fetch random words or structured definitions in Python for flashcards, daily notifications, or NLP training pipelines.
import requests
def get_daily_vocabulary(count=5, pos="adjective"):
url = "https://api.lexidata.dev/api/v1/random"
params = {"limit": count, "pos": pos}
response = requests.get(url, params=params)
response.raise_for_status()
words = response.json()["data"]
for item in words:
word = item["word"]
definition = item["senses"][0]["definition"] if item["senses"] else "N/A"
print(f"✨ {word.upper()}: {definition}")
if __name__ == "__main__":
get_daily_vocabulary()Errors & HTTP Status Codes
Lexidata uses conventional HTTP status codes to indicate the outcome of an API request.
| Status Code | Meaning | Description |
|---|---|---|
200 OK | Success | The request succeeded and the response payload contains data. |
400 Bad Request | Client Error | Required parameters missing or invalid query format. |
404 Not Found | Not Found | The requested word lemma does not exist in the dictionary. |
429 Too Many Requests | Rate Limited | Standard fair-use limit reached. Back off and retry shortly. |
500 Server Error | Internal Error | An unexpected error occurred on the service. |
{
"status": "error",
"error": {
"code": "WORD_NOT_FOUND",
"message": "The requested word 'xyznotaword' was not found in the lexical database."
}
}