# Wikiquote Quotes Scraper - Quotes by Person or Topic (`ninhothedev/wikiquote-scraper`) Actor

$0.5/1K 🔥 Fast Wikiquote scraper! Quotes by person or topic — clean text, source & page. No key. JSON, CSV, Excel or API in seconds. Search or list pages & pull thousands of quotes for content & NLP ⚡

- **URL**: https://apify.com/ninhothedev/wikiquote-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.

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

## Wikiquote Quotes Scraper 📜

Scrape clean, structured **quotes from [Wikiquote](https://www.wikiquote.org/)** — by person or by topic — in seconds. Search for pages matching a keyword, or extract every quote line (with its source/attribution) from any Wikiquote page. Powered by the public MediaWiki API, so results are fast, reliable and **datacenter-friendly** (no residential proxies, no login, no API key).

Perfect for building quote databases, content pipelines, NLP datasets, social-media schedulers and educational apps.

***

### ✨ Features

- **Two modes**: `search` (find pages by query) and `pages` (extract quotes from titles).
- **Clean output**: MediaWiki markup (`[[links]]`, `''italics''`, `<ref>`, `{{templates}}`) is fully stripped to plain, ready-to-use text.
- **Source / attribution** captured per quote from sub-bullet lines.
- **Multi-language**: any Wikiquote edition via the `language` field (`en`, `de`, `fr`, `es`, `it`, …).
- **Fast & cheap**: clean JSON API, no browser, runs on 512 MB.
- **Structured dataset** ready for CSV, JSON, Excel or API export.

***

### 🚀 Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `search` (query → matching pages) or `pages` (titles → quotes). |
| `query` | string | Search term when `mode = search` (e.g. `hope`). |
| `pages` | array | Page titles when `mode = pages` (e.g. `["Albert Einstein","Mahatma Gandhi"]`). |
| `language` | string | Wikiquote language edition. Default `en`. |
| `maxItems` | integer | Max items to push (default `200`, max `2000`). |

#### Example — extract quotes

```json
{
  "mode": "pages",
  "pages": ["Albert Einstein", "Mahatma Gandhi"],
  "language": "en",
  "maxItems": 500
}
```

#### Example — search pages

```json
{
  "mode": "search",
  "query": "hope",
  "maxItems": 50
}
```

***

### 📤 Output

**Search result** (`mode = search`):

```json
{
  "type": "page",
  "page": "Hope",
  "snippet": "Hope is a desire for future good...",
  "url": "https://en.wikiquote.org/wiki/Hope",
  "scraped_at": "2026-07-18T08:00:00+00:00"
}
```

**Quote** (`mode = pages`, one item per quote):

```json
{
  "type": "quote",
  "page": "Albert Einstein",
  "quote": "Everything should be made simple as possible but no simpler.",
  "source": "Repeated throughout his life, see: Quote Investigator",
  "url": "https://en.wikiquote.org/wiki/Albert_Einstein",
  "scraped_at": "2026-07-18T08:00:00+00:00"
}
```

***

### 💰 Pricing

Pay-per-result style usage: approximately **$0.50 per 1,000 quotes** on the Apify platform (plus platform usage). A single popular page can yield hundreds of clean quotes, making it one of the cheapest ways to build a quote dataset.

***

### 🎯 Use cases

- **Content creation** — populate blogs, newsletters and quote-of-the-day widgets.
- **NLP / ML** — build labelled quote corpora for sentiment, attribution and generation models.
- **Social media** — feed schedulers with fresh, attributed quotes by theme or author.
- **Education** — assemble teaching material, flashcards and study aids by topic or figure.

***

### 🆚 Comparison

| | Wikiquote Quotes Scraper | Manual copy-paste | Generic HTML scraper |
|---|---|---|---|
| Clean plain-text quotes | ✅ | ⚠️ manual cleanup | ❌ markup left in |
| Source/attribution | ✅ | ⚠️ | ❌ |
| Multi-language | ✅ | ⚠️ | ⚠️ |
| No proxies / key | ✅ | ✅ | ❌ often blocked |
| Structured export | ✅ | ❌ | ⚠️ |

***

### 🔗 Related actors

- [Wikipedia Scraper](https://apify.com/ninhothedev/wikipedia-scraper)
- [Wikidata Scraper](https://apify.com/ninhothedev/wikidata-scraper)
- [PoetryDB Scraper](https://apify.com/ninhothedev/poetrydb-scraper)
- [Dictionary Scraper](https://apify.com/ninhothedev/dictionary-scraper)

**Keywords:** wikiquote scraper, quotes scraper, famous quotes api, quotes by author, quotes by topic, quote database, inspirational quotes dataset, mediawiki quotes, nlp quotes corpus, quote of the day api

***

*Wikiquote content is available under the Creative Commons Attribution-ShareAlike License. This actor only accesses publicly available data via the official MediaWiki API. Please attribute Wikiquote when reusing content.*

# Actor input Schema

## `mode` (type: `string`):

What to scrape. 'search' finds Wikiquote pages matching a query (returns page titles + snippets). 'pages' extracts every quote line from the given page titles.

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

Used when mode = 'search'. A person, topic or keyword to search Wikiquote for (e.g. 'hope', 'Albert Einstein', 'freedom').

## `pages` (type: `array`):

Used when mode = 'pages'. Exact Wikiquote page titles to extract quotes from (e.g. 'Albert Einstein', 'Mahatma Gandhi'). Redirects are followed automatically.

## `language` (type: `string`):

Wikiquote language edition (subdomain), e.g. 'en', 'de', 'fr', 'es', 'it'. Defaults to English.

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

Maximum number of result items (pages or quotes) to push to the dataset.

## Actor input object example

```json
{
  "mode": "search",
  "query": "hope",
  "pages": [
    "Albert Einstein",
    "Mahatma Gandhi"
  ],
  "language": "en",
  "maxItems": 200
}
```

# 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 = {
    "query": "hope",
    "pages": [
        "Albert Einstein",
        "Mahatma Gandhi"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/wikiquote-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 = {
    "query": "hope",
    "pages": [
        "Albert Einstein",
        "Mahatma Gandhi",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/wikiquote-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 '{
  "query": "hope",
  "pages": [
    "Albert Einstein",
    "Mahatma Gandhi"
  ]
}' |
apify call ninhothedev/wikiquote-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/wikiquote-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/jMRYN7qdauZm1oPJt/builds/xqSSPhpNQQGedr5bl/openapi.json
