# Wiki Intelligence Actor (`the_hoodedman/wiki-intelligence-actor`) Actor

- **URL**: https://apify.com/the\_hoodedman/wiki-intelligence-actor.md
- **Developed by:** [MIchael Keller](https://apify.com/the_hoodedman) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 primary events

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/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

## Wiki Intelligence for Agents

**Structured Fandom and MediaWiki search, retrieval, revision monitoring, and bounded knowledge exports for agents and automation.**

Wiki Intelligence calls a public MediaWiki Action API over HTTP. It returns compact JSON records with page IDs, canonical source URLs, revision timestamps, and explicit bounds. It supports Fandom-hosted wikis and compatible public MediaWiki installations; API extensions and site configuration vary.

### What it does

- Search pages and retrieve normalized page text, categories, redirects, and revision provenance.
- Extract common `Infobox` template parameters with ambiguity and malformed-template flags.
- Enumerate category members, backlinks, and recent changes.
- Inspect revision metadata and compare two revisions with a bounded diff.
- Crawl a category to a caller limit (maximum 500 pages per run, recursion depth maximum 3).
- Export only category pages changed since a required timestamp.

One dataset record is written per useful hit/page/change. Records include `operation`, `source`, `retrievedAt`, `warnings`, and the operation-specific `data` object. Content is plain text where practical; infobox parsing is best-effort because templates are community-specific.

### Example inputs

Search:

```json
{
  "wikiUrl": "https://minecraft.fandom.com",
  "operation": "search_pages",
  "query": "redstone comparator",
  "limit": 10
}
```

Incremental category export:

```json
{
  "wikiUrl": "https://terraria.fandom.com",
  "operation": "knowledge_export",
  "category": "Bosses",
  "since": "2026-09-20T00:00:00Z",
  "limit": 100
}
```

See [`examples/`](examples/) for more operations and representative output.

### Limits and compatibility

- `limit` is 1–200 for ordinary operations and at most 500 for crawl/export.
- Category recursion is limited to depth 3; loops and duplicate page IDs are suppressed.
- API calls are sequential, rate-spaced, retried for transient errors, and time-limited.
- Text output is capped at 500,000 characters per page; response bodies are capped at 5 MB.
- `knowledge_export` requires `since` and returns pages in the selected category that have a matching recent-change record. It does not maintain durable state between runs.
- Arbitrary endpoints must be public hosts resolving only to public IP addresses. Private/local hosts and unsafe redirects are rejected. Do not treat this as a substitute for network egress controls in a self-hosted deployment.
- Private wikis, disabled APIs, custom API paths, and extensions that omit expected fields may not work. For nonstandard installs, pass the exact public `api.php` in `apiUrl`.
- Some APIs may suppress editor identities or revision content. Infobox layouts are not standardized; fields are returned with confidence/warnings rather than guessed.

### Attribution and licenses

The Actor does not own wiki text. It returns source URLs, page IDs, revision IDs, and timestamps so downstream systems can retain attribution and identify the precise source version.

Fandom says most wiki text uses CC BY-SA 3.0, while some communities use other licenses, including noncommercial variants. The license shown by the individual wiki governs reuse. Before redistributing or commercially using exported text, verify that wiki's license and the source terms, give attribution and a link to the original page, identify changes where applicable, and comply with ShareAlike or NonCommercial terms. API availability does not grant extra reuse rights. Images and other media may have separate rights and are not included as media files by this Actor.

Start with [Fandom's licensing policy](https://www.fandom.com/licensing), its [reuse guidance](https://support.fandom.com/hc/en-us/articles/360035075654-I-want-to-reuse-text-or-images-from-a-Fandom-wiki), and the target community's own license page. For standard MediaWiki installations, check the site-specific copyright/license page.

### Pricing and spending limits

The proposed PPE event is `knowledge-unit`, charged once when one result is written. Proposed launch price: **$0.001 per record** ($1 per 1,000). No charge is emitted for unsuccessful work. Keep Apify's synthetic `apify-actor-start` event at its default setting; configure only one result event to avoid double charging. Suggested minimum run charge limit: $0.001. Detailed assumptions and sample economics are in [`PRICING_NOTES.md`](PRICING_NOTES.md).

Set a per-run maximum charge in Apify before running. The SDK checks the result of each output charge and stops at the platform spending boundary. Usage costs are not passed through as a separate line item in the recommended pricing model. Agentic payments additionally require account KYC, which is an account-owner step.

### Run locally

```sh
npm install
npm test
npm start
```

For local execution, provide `INPUT.json` using Apify local storage conventions or run with Apify CLI. The Actor requires outbound HTTPS/DNS access to the target wiki and uses no proxy, browser, external API key, or telemetry.

### Build and deploy

1. The private GitHub repository is [TheHoodedMan04/wiki-intelligence-actor](https://github.com/TheHoodedMan04/wiki-intelligence-actor). It is intended to contain the contents of this folder (not the Money Goblin project parent); `.gitignore` excludes local dependencies/storage.
2. In Apify Console, go to **Actors → Develop new → Import from Git → GitHub**, select this repository and `main`, and leave the Actor unpublished/private. The account-owner may need to complete the GitHub authorization flow.
3. In the new Actor's **Source** tab, verify the repository URL and branch. For a private Git source, follow Apify's deployment-key prompt: copy the read-only public key and add it as a deploy key to this one GitHub repository.
4. Inspect the `.actor` configuration. Before choosing **Build**, check the account's platform usage and confirm the build/test will not incur paid usage. A build creates a platform image and may use platform resources; no build was started here.
5. If continuing with private QA, configure the Actor's permissions as limited and keep Standby off. Configure PPE with `knowledge-unit` at $0.001 per stored record and keep the synthetic start event at its default. Remove/disable synthetic dataset-item pricing if the Console shows that it would double-charge custom events. Set a $0.001 minimum max-total-charge amount and do not pass usage through.
6. Run the fixture suite locally. If platform usage is acceptable, run low-limit Wikipedia and Fandom samples with a strict max charge, inspect run cost and output, and revise `PRICING_NOTES.md` from measured usage.
7. To submit publicly later: open **Development → My Actors → \[Actor] → Publishing**, complete display information, monetization, sample output, output schema, and permissions, then select **Publish on Store** only after human approval. Actor listing visibility and source-code visibility are separate; Apify documents that source built from a private repository cannot be made public. If you want public source files, first move to a public repository or Apify-hosted source and review the license.
8. Complete payment/KYC account steps yourself if desired; they are required for payouts and agentic-payment eligibility and are outside this project.

No public or private Apify Actor, Apify account change, or Apify run was created. The private GitHub repository has been created and populated with this repo-ready project. Apify's GitHub import flow and private-repository deployment-key steps were verified in current docs; an Apify connection/build must be completed by the account owner.

### Local QA

Run `npm test` for deterministic mocked API and fixture tests. Public network smoke tests are reported separately in [`QA_REPORT.md`](QA_REPORT.md).

### Store listing draft

- **Suggested title:** Wiki Intelligence for Agents
- **Suggested slug:** `wiki-intelligence`
- **Short description:** Search, retrieve, monitor revisions, and export bounded, provenance-rich knowledge from public Fandom and MediaWiki sites.
- **Tags/categories:** AI, Automation, Developer tools, MCP servers, MediaWiki, Fandom, knowledge export
- **Pricing:** Pay per event, one `knowledge-unit` per output record, proposed $0.001 / unit.

Full listing text and release checks: [`STORE_LISTING.md`](STORE_LISTING.md), [`RELEASE_CHECKLIST.md`](RELEASE_CHECKLIST.md).

# Changelog

This Actor's version history is a separate document: https://apify.com/the\_hoodedman/wiki-intelligence-actor/changelog.md

# Actor input Schema

## `wikiUrl` (type: `string`):

Public Fandom or MediaWiki site URL, for example https://minecraft.fandom.com/wiki/Main\_Page.

## `apiUrl` (type: `string`):

Optional exact public api.php URL for wikis hosted under a nonstandard path.

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

Select a structured wiki operation.

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

Text to search for (search\_pages).

## `title` (type: `string`):

Page title for retrieval, backlinks, or revision operations.

## `category` (type: `string`):

Category name with or without the Category: prefix.

## `revisionId` (type: `integer`):

Revision ID for page\_revision\_info or the older revision in compare\_revisions.

## `newerRevisionId` (type: `integer`):

Newer revision ID for compare\_revisions.

## `since` (type: `string`):

ISO timestamp lower bound for recent\_changes or knowledge\_export.

## `limit` (type: `integer`):

Maximum returned records (1–200 for ordinary operations; crawl/export allow up to 500).

## `namespace` (type: `integer`):

Optional MediaWiki namespace ID filter.

## `depth` (type: `integer`):

Crawl only. Root is depth 0; bounded to 0–3.

## `maxDiffChars` (type: `integer`):

Compare only; truncates long diffs.

## Actor input object example

```json
{
  "operation": "search_pages",
  "limit": 20,
  "depth": 0,
  "maxDiffChars": 8000
}
```

# Actor output Schema

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

Structured wiki records in the default dataset.

# 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("the_hoodedman/wiki-intelligence-actor").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("the_hoodedman/wiki-intelligence-actor").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 the_hoodedman/wiki-intelligence-actor --silent --output-dataset

```

## MCP server setup

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

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/htxr7i7tRf5oatTYF/builds/YGEhbTHqQzYSKbXl9/openapi.json
