# Wiktionary Definitions Scraper (`real-estate-api/wiktionary-definitions-scraper`) Actor

Wiktionary Definitions Scraper is a Python tool designed to extract word definitions, parts of speech, etymologies, pronunciations, and translations from Wiktionary entries. It exports structured lexicographical data into clean CSV or JSON formats for language research and NLP applications.

- **URL**: https://apify.com/real-estate-api/wiktionary-definitions-scraper.md
- **Developed by:** [real-estate-api](https://apify.com/real-estate-api) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-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

### Wiktionary Definitions Scraper — Collect Word Definitions, Examples, and Language Data

### Overview

Wiktionary Definitions Scraper collects definitions for headwords from English Wiktionary and organizes them into structured dataset records by language and part of speech.

Filter results by language code, extract plain-text definitions and example sentences, and export the collected data to JSON, CSV, or Excel for language learning, dictionary projects, editorial review, and research.

### Features

- **Word definitions:** Collect definitions for one or more headwords.
- **Language filtering:** Filter results by language code, including English, French, and Dutch.
- **Part-of-speech grouping:** Organize definitions by grammatical category and language.
- **Example extraction:** Collect example sentences when available.
- **Plain-text output:** Remove HTML formatting from definition text.
- **Simplified definitions:** Provide a list of definitions for easier analysis.
- **Duplicate removal:** Remove duplicate word, language, and part-of-speech combinations.
- **Structured exports:** Export results to JSON, CSV, or Excel.

### Use Cases

- **Dictionary datasets:** Collect definitions for an existing word list.
- **Language learning:** Compare definitions across supported languages.
- **Editorial review:** Review definitions grouped by part of speech.
- **Linguistic research:** Organize definitions and examples for analysis.
- **Educational resources:** Prepare structured vocabulary datasets for learning materials.
- **Scheduled refreshes:** Reprocess word lists to generate updated datasets.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `words` | Array | `["water"]` | Headwords to look up. Provide one word per entry. Spaces are converted to underscores. |
| `languages` | Array | `["en"]` | Language codes to retain, such as `en`, `fr`, or `nl`. An empty list retains all available language blocks. |
| `maxItems` | Integer | `100` | Maximum number of definition records per run, clamped between 1 and 1,000. |
| `timeoutSecs` | Integer | `300` | Maximum time allowed for starting lookups, in seconds. |
| `requestTimeoutSecs` | Integer | `30` | Maximum wait time for an individual request, in seconds. |

### Example Input

This configuration looks up the word `water` and retains English definitions.

```json
{
  "words": ["water"],
  "languages": ["en"],
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

### Extracted Data

Each successful record represents a word and a particular language and part of speech. Definition entries may include example sentences when available.

| Field | Type | Description |
|---|---|---|
| `word` | String | Requested headword. |
| `languageCode` | String | Language identifier, such as `en`. |
| `partOfSpeech` | String | Part of speech associated with the definition group. |
| `language` | String | Language name provided by Wiktionary. |
| `definitions` | Array | Definition entries containing plain-text definitions and examples. |
| `plainDefinitions` | Array | Definition sentences in a simplified format for easier scanning. |
| `scrapedAt` | String | UTC timestamp indicating when the record was created. |

### Example Output

```json
{
  "word": "water",
  "languageCode": "en",
  "partOfSpeech": "Noun",
  "language": "English",
  "definitions": [
    {
      "definition": "An inorganic compound (of molecular formula H2O) found at room temperature and pressure as a clear liquid.",
      "examples": [
        "By the action of electricity, the water was resolved into its two parts, oxygen and hydrogen."
      ]
    }
  ],
  "plainDefinitions": [
    "An inorganic compound (of molecular formula H2O) found at room temperature and pressure as a clear liquid."
  ],
  "scrapedAt": "2026-10-12T00:00:00+00:00"
}
```

Actual results depend on the requested words, selected languages, and available Wiktionary entries.

### Working with Your Dataset

Choose an export format according to your workflow:

- **JSON:** Suitable for structured data processing and application development.
- **CSV:** Convenient for filtering and reviewing vocabulary in spreadsheets.
- **Excel:** Useful for organizing word lists, comparing definitions, and preparing educational materials.

For multilingual analysis, retain `languageCode` and `partOfSpeech` so each definition remains associated with the appropriate language and grammatical category.

### FAQ

#### Can I look up multiple words in one run?

Yes. Add each headword as a separate entry in the `words` array.

#### Can I collect definitions in multiple languages?

Yes. Specify the language codes you want in `languages`, such as `en`, `fr`, or `nl`. Use an empty array to retain all available language blocks.

#### What does each dataset record represent?

Each record represents a requested word for a particular language and part of speech. The record may contain multiple definitions and example sentences.

#### How many records can one run collect?

The default limit is 100 definition records. You can adjust `maxItems` from 1 to a maximum of 1,000.

#### What export formats are supported?

You can export the dataset as JSON, CSV, or Excel.

#### Are definitions and examples returned as plain text?

Yes. HTML formatting is removed from definition text, and `plainDefinitions` provides a simplified list of definition sentences. Example sentences are included when available.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with Wiktionary or the Wikimedia Foundation. Users are responsible for complying with applicable source terms and collection restrictions.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. Scraping is not the same thing as hacking, and there is no single law that bans it. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

Headwords to look up on English Wiktionary. One word or phrase per line. Spaces are sent as underscores.

## `languages` (type: `array`):

Wiktionary language codes to keep, such as en, fr, or nl. Leave the list empty to keep every language block in the response.

## `maxItems` (type: `integer`):

Maximum number of definition rows to save in one run. Values are clamped between 1 and 1000.

## `timeoutSecs` (type: `integer`):

Stop starting new lookups after this many seconds. The run still finishes successfully with the rows already saved.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for each Wiktionary HTTP response before retrying or recording an error.

## `proxyConfiguration` (type: `object`):

Optional proxy for Wiktionary requests. The default sends traffic directly, with Apify Proxy turned off.

## Actor input object example

```json
{
  "words": [
    "water",
    "river"
  ],
  "languages": [
    "en"
  ],
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset with one row per part of speech.

## `overview` (type: `string`):

Table view of word, part of speech, language, plain definitions, and source URL.

# 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 = {
    "words": [
        "water"
    ],
    "languages": [
        "en"
    ],
    "maxItems": 100,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("real-estate-api/wiktionary-definitions-scraper").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 = {
    "words": ["water"],
    "languages": ["en"],
    "maxItems": 100,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("real-estate-api/wiktionary-definitions-scraper").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 '{
  "words": [
    "water"
  ],
  "languages": [
    "en"
  ],
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call real-estate-api/wiktionary-definitions-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,real-estate-api/wiktionary-definitions-scraper"
        }
    }
}
```

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/tghEVtBCyl2xRWu5x/builds/anQqY7iyyjZg4Pkay/openapi.json
