# TV Tropes Scraper — Tropes, Examples & Page-Change Monitor (`scrapersdelight/tvtropes-scraper`) Actor

Scrape TV Tropes (which has no public API) — trope and work pages with title, description, examples & cross-linked tropes — by URL or by crawling a whole namespace. Monitor pages for edits on a schedule with Slack/email/webhook alerts. $4 per 1,000 pages.

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

## Pricing

from $4.00 / 1,000 per record returneds

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## 📚 TV Tropes Scraper — Tropes, Examples & Change Monitor

**Turn [TV Tropes](https://tvtropes.org) into structured data — it has no public API, but this actor reads its pages directly: trope and work pages with title, description, the full list of examples, and every cross-linked trope/work. Scrape by URL, or crawl a whole namespace. Run it on a schedule to monitor pages for edits and get Slack / email / webhook alerts.**

No login, no JavaScript rendering — TV Tropes pages are server-rendered HTML.

---

### What does it do?

For each trope or work page it returns clean, structured data you can export to **JSON, CSV, Excel, or push to your app via API**:

- 🏷️ **Title, namespace, page type** (trope / Film / Series / VideoGame / …)
- 📝 **Description** (the page's intro paragraphs)
- 📋 **Examples** — the list entries (+ folder section labels)
- 🔗 **Cross-links** — every linked trope/work with its `{namespace, name, url}`
- 🧬 **Content hash** for change detection

---

### What data does it extract?

For every page: `url`, `namespace`, `name`, `title`, `page_type`, `description`, `links[]` (`{text, namespace, name, url}`), `link_count`, `examples[]`, `example_count`, `folders[]`, `content_hash`, `change` (monitor: new / updated / unchanged), `scraped_at`.

---

### Who is it for?

- 🤖 **AI / ML / dataset builders** — trope graphs and example corpora are popular for NLP and story-modeling.
- ✍️ **Writers & researchers** mapping tropes across works.
- 📊 **Wiki analysts** tracking how pages and examples evolve over time (the wiki edits daily).

---

### How to use it (step by step)

1. Click **Try for free**.
2. Paste **page URLs** (or `Namespace/Name`) — or set a **namespace** to crawl (e.g. `Main`, `Film`).
3. *(Optional)* toggle **examples** / **cross-links**.
4. Click **Start**, open the **Dataset** tab to view/export.
5. *(Optional)* set **monitorMode** + a **Schedule** to get alerts when pages change.

#### Quick start

```json
{ "pageUrls": ["Main/ChekhovsGun", "Series/BreakingBad"] }
````

***

### Input

| Field | What it does |
|-------|--------------|
| `pageUrls` | TV Tropes page URLs / `Namespace/Name` |
| `namespace`, `namespaceStartLetter` | crawl a whole namespace via the index |
| `includeExamples`, `includeLinks` | toggle example list / cross-links |
| `maxPages` | hard cap per run (0 = all) |
| `monitorMode`, `alertOnChange` | recurring change watcher + alerts |
| `webhookUrl`, `slackWebhookUrl`, `emailRecipients` | alert channels |
| `proxyConfiguration`, `requestConcurrency` | proxy + parallelism |

***

### Output

Each page is one dataset record (fields above). Export to **JSON, CSV, Excel, HTML, or RSS**, or fetch via the **Apify API**.

***

### How much does it cost?

Pay-per-event — you pay for what you pull:

| Event | What it covers | Suggested price |
|-------|----------------|-----------------|
| `lot-scraped` | each page returned | ~$0.003 / page |
| `monitor-run-completed` | each scheduled watch run | ~$0.05 / run |
| `new-lot-detected` | each new/changed page | ~$0.02 / page |
| `alert-delivered` | each Slack/email/webhook push | ~$0.005 / alert |

*(Final per-event prices are set on the actor's pricing page.)*

***

### Is it legal to scrape TV Tropes?

TV Tropes content is publicly viewable and contributed under the site's terms (Creative Commons BY-NC-SA). This actor reads public pages — no personal data. Scraping public pages is generally legal, but **you are responsible for your use — review TV Tropes' Terms of Service, attribute, and respect the non-commercial share-alike license when redistributing.**

***

### FAQ

**TV Tropes has no API — how does this work?**
It reads the server-rendered HTML pages directly and parses them, so you get structured data without an API.

**Can I crawl a whole category?**
Yes — set `namespace` (e.g. `Main` for all tropes) and a `maxPages` cap; the actor enumerates the index.

**Can I detect when a page changes?**
Yes — `monitorMode` hashes each page and emits only new/changed pages, with alerts.

**How do I export?**
JSON, CSV, Excel, HTML, or RSS from the Dataset tab, or via the Apify API.

***

### Feedback

Want laconic/quote extraction, image lists, or per-folder example grouping? Open an issue on the actor.

# Actor input Schema

## `pageUrls` (type: `array`):

TV Tropes pages — full URLs, 'Namespace/Name' (e.g. Film/Inception), or a bare trope name (assumed Main/). Trope pages and work pages both supported.

## `namespace` (type: `string`):

Optional: enumerate and scrape a whole namespace via the index (e.g. 'Main' for tropes, 'Film', 'Series', 'VideoGame'). Use with Max pages.

## `namespaceStartLetter` (type: `string`):

Optional letter to scope the namespace index (the index is paginated by first letter).

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

Include the list of example entries (and folder labels) on the page.

## `includeLinks` (type: `boolean`):

Include the cross-linked tropes/works (a.twikilink) with their namespace/name.

## `maxPages` (type: `integer`):

Hard cap per run (0 = all).

## `monitorMode` (type: `boolean`):

Recurring watcher: hash each page's content and output/alert ONLY pages that are new or changed since the last run. Pair with an Apify Schedule.

## `alertOnChange` (type: `boolean`):

In monitor mode, alert for each new/changed page.

## `webhookUrl` (type: `string`):

POST endpoint for change alerts.

## `slackWebhookUrl` (type: `string`):

Slack incoming-webhook URL.

## `emailRecipients` (type: `array`):

Emails for the change digest (via apify/send-mail).

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

Proxy settings. A datacenter proxy + the built-in browser-like fingerprint clears the bare-IP block.

## `requestConcurrency` (type: `integer`):

Max parallel page fetches. Keep modest to respect the site.

## `diagnose` (type: `boolean`):

Dev only. Logs the parsed first page, then exits.

## Actor input object example

```json
{
  "pageUrls": [
    "Main/ChekhovsGun"
  ],
  "includeExamples": true,
  "includeLinks": true,
  "maxPages": 0,
  "monitorMode": false,
  "alertOnChange": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "requestConcurrency": 4,
  "diagnose": false
}
```

# Actor output Schema

## `pages` (type: `string`):

The dataset of scraped trope/work pages (one item per page).

# 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 = {
    "pageUrls": [
        "Main/ChekhovsGun"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapersdelight/tvtropes-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 = { "pageUrls": ["Main/ChekhovsGun"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapersdelight/tvtropes-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "pageUrls": [
    "Main/ChekhovsGun"
  ]
}' |
apify call scrapersdelight/tvtropes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapersdelight/tvtropes-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TV Tropes Scraper — Tropes, Examples & Page-Change Monitor",
        "description": "Scrape TV Tropes (which has no public API) — trope and work pages with title, description, examples & cross-linked tropes — by URL or by crawling a whole namespace. Monitor pages for edits on a schedule with Slack/email/webhook alerts. $4 per 1,000 pages.",
        "version": "0.1",
        "x-build-id": "Gu8aIYhdfwHEZcamx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapersdelight~tvtropes-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapersdelight-tvtropes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapersdelight~tvtropes-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapersdelight-tvtropes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapersdelight~tvtropes-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapersdelight-tvtropes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "pageUrls": {
                        "title": "Page URLs / names",
                        "type": "array",
                        "description": "TV Tropes pages — full URLs, 'Namespace/Name' (e.g. Film/Inception), or a bare trope name (assumed Main/). Trope pages and work pages both supported.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "namespace": {
                        "title": "Crawl a namespace",
                        "type": "string",
                        "description": "Optional: enumerate and scrape a whole namespace via the index (e.g. 'Main' for tropes, 'Film', 'Series', 'VideoGame'). Use with Max pages."
                    },
                    "namespaceStartLetter": {
                        "title": "Namespace start letter",
                        "type": "string",
                        "description": "Optional letter to scope the namespace index (the index is paginated by first letter)."
                    },
                    "includeExamples": {
                        "title": "Include examples",
                        "type": "boolean",
                        "description": "Include the list of example entries (and folder labels) on the page.",
                        "default": true
                    },
                    "includeLinks": {
                        "title": "Include cross-links",
                        "type": "boolean",
                        "description": "Include the cross-linked tropes/works (a.twikilink) with their namespace/name.",
                        "default": true
                    },
                    "maxPages": {
                        "title": "Max pages per run",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Hard cap per run (0 = all).",
                        "default": 0
                    },
                    "monitorMode": {
                        "title": "Monitor mode (change watcher)",
                        "type": "boolean",
                        "description": "Recurring watcher: hash each page's content and output/alert ONLY pages that are new or changed since the last run. Pair with an Apify Schedule.",
                        "default": false
                    },
                    "alertOnChange": {
                        "title": "Alert on changes",
                        "type": "boolean",
                        "description": "In monitor mode, alert for each new/changed page.",
                        "default": true
                    },
                    "webhookUrl": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "POST endpoint for change alerts."
                    },
                    "slackWebhookUrl": {
                        "title": "Slack webhook URL",
                        "type": "string",
                        "description": "Slack incoming-webhook URL."
                    },
                    "emailRecipients": {
                        "title": "Email recipients",
                        "type": "array",
                        "description": "Emails for the change digest (via apify/send-mail).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Proxy settings. A datacenter proxy + the built-in browser-like fingerprint clears the bare-IP block.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "requestConcurrency": {
                        "title": "Request concurrency",
                        "minimum": 1,
                        "maximum": 6,
                        "type": "integer",
                        "description": "Max parallel page fetches. Keep modest to respect the site.",
                        "default": 4
                    },
                    "diagnose": {
                        "title": "Diagnostic mode (dev)",
                        "type": "boolean",
                        "description": "Dev only. Logs the parsed first page, then exits.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
