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.

BASE URL
https://api.lexidata.dev
ProtocolHTTPS (REST / JSON)
AuthenticationNone (Open Access)
EncodingUTF-8
CORSEnabled (Browser Ready)

Quickstart in 30 Seconds

You can start querying Lexidata immediately using direct HTTP requests, our official JavaScript client, or Python.

cURL Quickstart
curl -s "https://api.lexidata.dev/api/v1/words/serendipity"
JavaScript / Node.js SDK
// 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:

01

Lemma (Word)

The base canonical dictionary form of a word. For example, running, ran, and runs map to the base lemma run.

02

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.

03

Word Sense

Words often have multiple meanings. Each meaning is a sense containing its part of speech, definition, synset ID, and sample usage sentences.

04

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.

GET/api/v1/words/:word

Path Parameters

ParameterTypeRequiredDescription
:wordstringYesThe English word or lemma to look up (e.g. serendipity).
Interactive Live Tester
Try words:
/api/v1/words/
curl -s "https://api.lexidata.dev/api/v1/words/serendipity"

Random Words

Fetch pseudo-random vocabulary items. Ideal for word games, vocabulary building, flashcards, and machine learning test samples.

GET/api/v1/random?limit=:count&pos=:pos

Query Parameters

ParameterTypeDefaultDescription
limitinteger1Number of words to generate (1–50).
pos / partOfSpeechstringnoneOptional filter by part of speech (noun, verb, adjective, adverb).
Interactive Random Tester

Dataset Exports

Generate streamed or downloadable lexical datasets formatted for data science, NLP corpus creation, or bulk system integration.

GET/api/v1/dataset?format=:fmt&fields=:fields&startsWith=:prefix
JSON (Array)JSONL (Streaming Lines)CSV (Spreadsheet)TXT (Wordlist)

Query Parameters

ParameterTypeDefaultDescription
formatstringjsonExport format: json, jsonl, csv, or txt.
fieldsstringmeaningPreset name (basic, meaning, linguistic, all) or comma-separated column names.
startsWith / endsWith / containsstringnoneMorphological substring filters.
limitinteger50Maximum rows to stream (up to 1,000 per request).
Dataset Preview Generator
Open Full Studio →

Field Reference & Schema

Reference for all lexical attributes and field projection options available in Lexidata.

wordstring

The standard lemma representation (e.g. "serendipity").

part_of_speechstring[]

Grammatical classifications: noun, verb, adjective, or adverb.

pronunciationsstring[]

Phonetic transcriptions formatted in International Phonetic Alphabet (IPA).

synsetsstring[]

WordNet 8-digit synset offsets with POS suffix (e.g. 07525381-n).

definitionsstring[]

Sense-level explanatory definitions describing the word's meaning.

examplesstring[]

Contextual sentences illustrating authentic grammatical usage.

relationsobject[]

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.

RECIPE 01

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");
RECIPE 02

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);
RECIPE 03

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();
RECIPE 04

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 CodeMeaningDescription
200 OKSuccessThe request succeeded and the response payload contains data.
400 Bad RequestClient ErrorRequired parameters missing or invalid query format.
404 Not FoundNot FoundThe requested word lemma does not exist in the dictionary.
429 Too Many RequestsRate LimitedStandard fair-use limit reached. Back off and retry shortly.
500 Server ErrorInternal ErrorAn unexpected error occurred on the service.
Standard Error Response Format
{
  "status": "error",
  "error": {
    "code": "WORD_NOT_FOUND",
    "message": "The requested word 'xyznotaword' was not found in the lexical database."
  }
}