# Spanish Wiktionary Definitions Scraper (`automation-lab/spanish-wiktionary-definitions`) Actor

Look up Spanish terms and export definitions, parts of speech, pronunciations, etymologies, inflections, examples, related terms, and source links.

- **URL**: https://apify.com/automation-lab/spanish-wiktionary-definitions.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.04 / 1,000 item extracteds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Spanish Wiktionary Definitions Scraper

Export **Spanish Wiktionary definitions** as structured, sense-level lexical records.
Give the Actor a list of words or phrases and receive Spanish definitions, parts of
speech, pronunciation metadata, audio links, etymologies, inflections, usage notes,
examples, synonyms, antonyms, related terms, revision provenance, and a status for
every processed term.

The Actor uses the official anonymous MediaWiki API for `es.wiktionary.org`.
It does not need cookies, a Wiktionary account, or a browser.

### What can you do with this Actor?

- Enrich vocabulary lists for language-learning products.
- Build repeatable Spanish lexical datasets for NLP and search pipelines.
- Add dictionary context to publishing and editorial workflows.
- Resolve batches of terms without manually copying individual pages.
- Schedule the same term list and compare revision IDs or records downstream.
- Export results to JSON, CSV, Excel, Google Sheets, a database, or a webhook.

Each successful output row represents one Spanish sense, not an opaque copy of a
whole page. Missing terms also produce a clear status row, so batch jobs can account
for every lookup.

### Who is it for?

**Language-learning teams** can turn lesson vocabulary into definitions and
pronunciation metadata.

**NLP and search engineers** can enrich terms with part-of-speech, sense, and
relationship fields while retaining source provenance.

**Publishers and researchers** can create reviewable lexical exports without
manually navigating hundreds of entries.

**Data teams** can schedule recurring Apify runs and route the default dataset to
existing integrations.

### What data does it extract?

| Field | Meaning |
| --- | --- |
| `term` | Original input term |
| `normalizedTerm` | Wiktionary page title after redirects |
| `status` | `found`, `not_found`, `no_spanish_entry`, or `no_senses` |
| `languageCode`, `languageName` | Fixed Spanish language qualification |
| `partOfSpeech` | Source part-of-speech heading |
| `grammaticalGender` | Normalized gender when stated in the heading |
| `senseNumber` | Sense number shown by Wiktionary |
| `definition` | Rendered Spanish definition |
| `usageLabels`, `usageNotes` | Domain labels and usage guidance |
| `examples` | Examples attached to the sense, when available |
| `synonyms`, `antonyms` | Relationships attached to the sense |
| `relatedTerms` | Up to 50 phrases and see-also terms |
| `inflections` | Label/value pairs such as plural or feminine forms |
| `pronunciation` | IPA, syllabification, and rhyme when available |
| `audio` | Direct Wikimedia audio URLs and labels |
| `etymology` | Rendered etymology associated with the entry section |
| `sourceUrl` | Wiktionary URL anchored to the Spanish section |
| `revisionId` | Source page revision returned by the API |
| `retrievedAt` | UTC retrieval timestamp |

Wiktionary entries are community-maintained. A field can be empty when contributors
have not supplied that metadata.

### How to look up Spanish terms

1. Open the Actor in Apify Console.
2. Enter one or more terms in **Spanish terms**.
3. Keep the optional metadata switches enabled for a rich export.
4. Set **Maximum output rows** for your downstream budget.
5. Click **Start**.
6. Open the **Dataset** tab to preview, download, or integrate the records.

A useful first input is:

```json
{
  "terms": ["casa", "hablar", "murciélago"],
  "maxItems": 100,
  "includeExamples": true,
  "includeRelatedTerms": true
}
```

### Input parameters

#### `terms`

Required array of 1–500 words or phrases. Whitespace is trimmed, Unicode is
normalized to NFC, and duplicate terms are processed once. Each value can contain
up to 200 characters.

#### `maxItems`

Maximum total number of sense and status rows. The default is 1,000 and the hard
maximum is 10,000. The Actor stops before saving more than this value; a term with
many senses can consume several rows.

#### `includeExamples`

When `true` (default), keep examples attached to individual senses. Set it to
`false` for a compact enrichment table.

#### `includeRelatedTerms`

When `true` (default), include up to 50 related phrases or see-also terms from the
Spanish section. Set it to `false` when only core lexical fields are needed.

### Output example

A real `casa` row has this shape (timestamps and revision IDs change as the source
changes):

```json
{
  "term": "casa",
  "normalizedTerm": "casa",
  "languageCode": "es",
  "languageName": "Español",
  "status": "found",
  "partOfSpeech": "Sustantivo femenino",
  "grammaticalGender": "feminine",
  "senseNumber": "1",
  "definition": "Edificación destinada a vivienda.",
  "usageLabels": ["vivienda"],
  "usageNotes": [],
  "examples": [],
  "synonyms": [],
  "antonyms": [],
  "relatedTerms": ["amo de casa"],
  "inflections": [{ "label": "plural", "value": "casas" }],
  "pronunciation": {
    "ipa": ["[ˈkasa]"],
    "syllabification": "ca-sa",
    "rhyme": "a.sa"
  },
  "audio": [],
  "etymology": "Del latín casa ('choza'), de origen incierto.",
  "sourceUrl": "https://es.wiktionary.org/wiki/casa#Español",
  "revisionId": 6357178,
  "retrievedAt": "2026-09-13T06:00:00.000Z"
}
```

A term that does not exist receives a row with `status: "not_found"` and nullable
lexical fields. Status rows are not charged as found items.

### How much does it cost to extract Spanish Wiktionary definitions?

Pay-per-event pricing contains a **$0.005 start fee** and one `item` event for each
`found` sense row. At the BRONZE tier, the item price is **$0.0084 per found sense**.
Missing or non-Spanish status rows have no item charge.

Approximate BRONZE totals:

| Found sense rows | Estimated total |
| ---: | ---: |
| 1 | $0.0134 |
| 10 | $0.0890 |
| 25 | $0.2150 |
| 100 | $0.8450 |

The exact total depends on how many senses the supplied terms have. Apify Console
shows the active tier and charge events before a run.

### Limits and predictable failure behavior

- The source is the Spanish-language Wiktionary only.
- The Actor does not translate definitions or infer absent metadata.
- It reads the entry's `Español` section and ignores other language sections.
- A redirected page preserves the input in `term` and reports the resolved title in
  `normalizedTerm`.
- Transient timeouts, HTTP 429 responses, and selected 5xx responses receive up to
  two bounded retries.
- Deterministic API errors are not retried blindly.
- An upstream failure after retries fails the run instead of returning a misleading
  empty success.
- Community edits can change headings, definitions, or available fields over time.

### Tips for better lexical exports

- Use accented spellings when they are known; redirects still handle many variants.
- Budget `maxItems` by senses rather than by input words.
- Disable related terms for smaller CSVs and embedding inputs.
- Preserve `revisionId`, `sourceUrl`, and `retrievedAt` when comparing scheduled
  exports.
- Keep status rows in batch pipelines so missing vocabulary is explicit.
- Respect Wikimedia request and attribution expectations in downstream products.

### Recurring pipelines and integrations

Use an Apify Schedule to rerun a stable term list. Then connect the default dataset
to Google Sheets, Make, Zapier, a webhook, or your own API consumer. For change
tracking, compare `revisionId` first and then diff the lexical fields that matter to
your application.

The Actor itself does not send alerts or maintain historical snapshots. Scheduling,
notifications, and snapshot retention are configured through Apify or your
integration.

### Run with the Apify API using cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~spanish-wiktionary-definitions/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "terms": ["casa", "trabajo", "tiempo"],
    "maxItems": 100,
    "includeExamples": true,
    "includeRelatedTerms": true
  }'
```

Poll the returned run ID, then download items from its default dataset.

### Run with JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/spanish-wiktionary-definitions').call({
  terms: ['ser', 'estar', 'haber'],
  maxItems: 100,
  includeExamples: false,
  includeRelatedTerms: false,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Run with Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/spanish-wiktionary-definitions").call(
    run_input={
        "terms": ["casa", "hablar"],
        "maxItems": 100,
        "includeExamples": True,
        "includeRelatedTerms": True,
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

### Use through MCP

#### Claude Code

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/spanish-wiktionary-definitions"
```

#### Claude Desktop, Cursor, and VS Code

Add this server to the client's MCP JSON configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/spanish-wiktionary-definitions"
    }
  }
}
```

Example prompts:

- “Look up `casa`, `hogar`, and `vivienda` and return their Spanish senses.”
- “Create compact lexical records for `ser`, `estar`, and `haber` without related
  terms.”
- “Which supplied terms have no Spanish Wiktionary entry?”

### Responsible use and licensing

Wiktionary content is collaborative and carries Wikimedia licensing and attribution
requirements. Review the current license notices on Wiktionary, preserve source
links, provide attribution where required, and follow share-alike obligations for
derivative datasets. Do not use the output to misrepresent community content as
professional linguistic, medical, legal, or safety advice.

This Actor accesses public pages through the official anonymous API. You remain
responsible for your input, run frequency, storage, redistribution, and compliance
with applicable laws and source terms.

### Troubleshooting

#### Why did one word produce many rows?

Wiktionary can list multiple parts of speech and numbered senses. The Actor emits one
row per sense so downstream consumers do not need to split a page-shaped blob.

#### Why is pronunciation, audio, or etymology empty?

The Spanish entry may not contain that field. The Actor reports available source
metadata and does not fabricate missing linguistic information.

#### Why did I receive `no_spanish_entry`?

The page exists, but its first parsed language section is not Spanish or no Spanish
section is available through the requested page section. Check the spelling and the
linked source page.

#### Why did the run stop at part of my input?

`maxItems` counts output rows, not terms. Increase it if early terms have many senses.
The limit is always respected.

### Related automation-lab Actors

- [`automation-lab/dataset-dedup`](https://apify.com/automation-lab/dataset-dedup)
  can remove duplicate rows after combining scheduled exports.
- [`automation-lab/csv-diff-tool`](https://apify.com/automation-lab/csv-diff-tool)
  can compare successive lexical exports outside this Actor.

These are optional downstream utilities. Spanish Wiktionary Definitions Scraper is
standalone and does not require another Actor.

### FAQ

**Does it support English Wiktionary?** No. The product is intentionally scoped to
Spanish entries on `es.wiktionary.org`.

**Does it use a browser or proxy?** No. It uses the official anonymous MediaWiki API
over direct HTTP.

**Are missing terms charged?** They receive a dataset status row, but only `found`
sense rows emit the `item` charge.

**Can I download Excel?** Yes. Use the Dataset export controls or API format options
after the run.

**Can it monitor changes?** Apify Schedules can rerun the input. Compare revision IDs
or datasets downstream; the Actor does not persist a change history or send alerts.

# Actor input Schema

## `terms` (type: `array`):

Words or phrases to look up. Duplicate terms are processed once. Maximum 500 terms per run.

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

Stop after this many sense or status records across all terms.

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

Include examples attached to each Wiktionary sense when available.

## `includeRelatedTerms` (type: `boolean`):

Include up to 50 related phrases and see-also terms from the Spanish entry.

## Actor input object example

```json
{
  "terms": [
    "casa",
    "hablar",
    "murciélago"
  ],
  "maxItems": 20,
  "includeExamples": true,
  "includeRelatedTerms": true
}
```

# Actor output Schema

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

Default dataset view containing one row per Spanish sense or one status row for an unresolved term.

# 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 = {
    "terms": [
        "casa",
        "hablar",
        "murciélago"
    ],
    "maxItems": 20,
    "includeExamples": true,
    "includeRelatedTerms": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/spanish-wiktionary-definitions").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 = {
    "terms": [
        "casa",
        "hablar",
        "murciélago",
    ],
    "maxItems": 20,
    "includeExamples": True,
    "includeRelatedTerms": True,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/spanish-wiktionary-definitions").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 '{
  "terms": [
    "casa",
    "hablar",
    "murciélago"
  ],
  "maxItems": 20,
  "includeExamples": true,
  "includeRelatedTerms": true
}' |
apify call automation-lab/spanish-wiktionary-definitions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/spanish-wiktionary-definitions"
        }
    }
}
```

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/TVH9uYC3F1AfMx8Xc/builds/qiwfJXy7fCbWcxwHS/openapi.json
