# Multi-Source Dictionary & Word Intelligence API (`nickespy/word-intelligence-api`) Actor

Enrich words with bundled WordNet definitions plus live DictionaryAPI.dev and Datamuse results.

- **URL**: https://apify.com/nickespy/word-intelligence-api.md
- **Developed by:** [Nick Espy](https://apify.com/nickespy) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 successful results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Multi-Source Dictionary & Word Intelligence API

Look up and enrich English words using three complementary sources:

- **WordNet 3.0** bundled inside the Actor for dependable local definitions and semantic relationships
- **DictionaryAPI.dev** for live dictionary definitions, examples, phonetics, and audio URLs
- **Datamuse** for related words, rhymes, sound-alikes, spelling suggestions, and reverse-dictionary searches

The Actor normalizes source results into consistent JSON, preserves provenance, and returns partial lookup results when an optional live source is unavailable.

### Operations

#### Dictionary lookup

```json
{
  "operation": "lookup",
  "words": ["education", "technology"],
  "sources": ["wordnet", "dictionaryapi", "datamuse"],
  "maxRelatedResults": 25
}
```

Produces one dataset item per unique word with definitions, examples, pronunciations, etymologies, synonyms, antonyms, WordNet relationships, source status, and attribution.

#### Related words

```json
{
  "operation": "related",
  "words": ["education"],
  "relation": "synonyms",
  "sources": ["wordnet", "datamuse"],
  "maxRelatedResults": 25
}
```

Relationships include synonyms, antonyms, rhymes, near rhymes, sounds-like, spelled-like, broader terms, narrower terms, associated words, and frequent neighbors.

#### Reverse dictionary

```json
{
  "operation": "reverse_dictionary",
  "query": "a device that converts sunlight into electricity",
  "sources": ["datamuse"],
  "maxRelatedResults": 25
}
```

#### Spelling suggestions

```json
{
  "operation": "suggest",
  "query": "hipopatamus",
  "sources": ["datamuse"],
  "maxRelatedResults": 10
}
```

### Source compatibility

- `lookup`: WordNet, DictionaryAPI.dev, and Datamuse
- `related`: WordNet and Datamuse
- `reverse_dictionary`: Datamuse
- `suggest`: Datamuse

An operation with no compatible selected source is rejected before processing. If a compatible source is selected alongside an incompatible one, the incompatible source is reported as `not_applicable`. Reverse-dictionary and suggestion runs fail when Datamuse fails because those operations have no fallback source.

### Output

The default dataset contains one item per word or query. Each item includes a `sourceStatus` object so consumers can distinguish complete, partial, not-found, failed, and not-applicable results:

```json
{
  "word": "education",
  "found": true,
  "definitions": [],
  "pronunciations": [],
  "synonyms": [],
  "antonyms": [],
  "sourceStatus": {
    "wordnet": { "status": "success", "mode": "bundled", "version": "3.0" },
    "dictionaryapi": { "status": "success", "mode": "live", "httpStatus": 200 },
    "datamuse": { "status": "success", "mode": "live", "httpStatus": 200 }
  }
}
```

The default key-value store also contains `SUMMARY`, with run totals and per-source success, not-found, failure, and not-applicable counts.

### Reliability and limits

- WordNet runs locally and remains available without network access.
- Live requests use timeouts, a 2 MB response limit, content-type and response-shape validation, bounded retries, exponential backoff, jitter, and `Retry-After` support.
- Live calls are deduplicated within a run and paced separately for each upstream source.
- A failure from one optional lookup source does not discard valid results from another source.
- Duplicate words are removed case-insensitively.
- Inputs are limited to 100 unique words, 200 Datamuse results per item, and five concurrent word jobs.
- Raw source payloads are excluded by default to keep datasets small.
- Unknown fields, invalid enum values, non-string words, and out-of-range limits are rejected rather than silently changed.

### Provenance and privacy

Every normalized definition or result identifies its immediate source. DictionaryAPI.dev entry-level and phonetic-level source URLs and license metadata are retained when provided. Datamuse states that definition metadata comes from WordNet and Wiktionary, but its response does not identify which source supplied each individual definition; output records disclose that limitation.

WordNet lookups stay inside the Actor. Words or queries sent to DictionaryAPI.dev or Datamuse leave Apify and are subject to those services' handling. Datamuse says it keeps query logs temporarily and discards them at the end of the day. Do not submit confidential or personal data as a word or query.

### Data sources and attribution

- [Princeton WordNet](https://wordnet.princeton.edu/) — bundled WordNet 3.0 database under the Princeton WordNet License
- [DictionaryAPI.dev](https://dictionaryapi.dev/) — live English dictionary API; source-specific metadata is preserved when returned
- [Datamuse](https://www.datamuse.com/api/) — live word-finding and lexical relationship API

See [ATTRIBUTION.md](ATTRIBUTION.md) for required notices and third-party provenance. The Actor source code is licensed under the MIT License; bundled and live third-party data remains under its applicable source license or terms.

### Datamuse API transition

Datamuse states that API keys will be required beginning February 1, 2027, with access limited to 100,000 requests per day per key. Version 0.1 uses the currently available unauthenticated endpoint. A protected bring-your-own-key input must be added before that transition date.

### Local development

```bash
npm install
npm run check
npm test
APIFY_LOCAL_STORAGE_DIR=./storage npm start
```

Place local Actor input at:

```text
storage/key_value_stores/default/INPUT.json
```

### Cost behavior

This Actor does not use a browser, proxy, or paid AI model. Costs primarily come from short compute time, external data transfer, and dataset writes. Start with two or three words when testing.

# Actor input Schema

## `operation` (type: `string`):

Choose a dictionary lookup, a related-word relationship, a reverse-dictionary search, or spelling suggestions.

## `words` (type: `array`):

Words to process for Dictionary lookup or Related words. Duplicates are removed case-insensitively.

## `query` (type: `string`):

For Reverse dictionary, describe the concept. For Suggestions, enter a partial or misspelled word.

## `relation` (type: `string`):

Relationship used by the Related words operation.

## `sources` (type: `array`):

WordNet is bundled locally. DictionaryAPI.dev supports lookup only. Datamuse supports every operation and is required for reverse dictionary and suggestions. Incompatible selected sources are reported as not applicable.

## `maxRelatedResults` (type: `integer`):

Maximum Datamuse results per word or query.

## `includeExamples` (type: `boolean`):

Include available example sentences from WordNet and DictionaryAPI.dev.

## `includeAudio` (type: `boolean`):

Include pronunciation audio URLs returned by DictionaryAPI.dev.

## `includeSourcePayloads` (type: `boolean`):

Useful for debugging but substantially increases output size.

## `concurrency` (type: `integer`):

Number of words processed simultaneously. Live requests are additionally paced per source to respect free APIs.

## Actor input object example

```json
{
  "operation": "lookup",
  "words": [
    "education",
    "technology"
  ],
  "query": "",
  "relation": "synonyms",
  "sources": [
    "wordnet",
    "dictionaryapi",
    "datamuse"
  ],
  "maxRelatedResults": 25,
  "includeExamples": true,
  "includeAudio": true,
  "includeSourcePayloads": false,
  "concurrency": 4
}
```

# Actor output Schema

## `results` (type: `string`):

One normalized dataset item per input word or query.

## `summary` (type: `string`):

Input, source success counts, and processing totals.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nickespy/word-intelligence-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("nickespy/word-intelligence-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call nickespy/word-intelligence-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nickespy/word-intelligence-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/B9bTqFSTe3r92KhNY/builds/c7u22pbaMMsoqZLlh/openapi.json
