# Wikipedia Summary (API-first) — EN/RU (`adaptable_initiative/my-actor`) Actor

EN: Fast, stable Wikipedia summaries via official REST API. Always SUCCEEDED; returns FOUND/NOT_FOUND with canonical URL and extract.
RU: Быстрые устойчивые сводки из Википедии через официальное REST-API. Всегда SUCCEEDED; статус FOUND/NOT_FOUND, канонический URL и аннотация.

- **URL**: https://apify.com/adaptable_initiative/my-actor.md
- **Developed by:** [Anatoliy Shilkov](https://apify.com/adaptable_initiative) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Full permissions
- **Stats:** 6 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 wikipedia summary requests

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

Wikipedia Summary (API-first) — EN

Summary: Given an input topic, this actor calls Wikipedia’s official REST API and returns a structured summary (title, extract, canonical URL). If the page does not exist, the actor does not fail: it finishes with SUCCEEDED and status: NOT_FOUND.
•	Stable for automation/iPaaS pipelines
•	No HTML scraping, no bypassing protections — public Wikipedia APIs only
•	Fast response (typically 0.2–1.2 s/run), minimal resources

What the actor does
1\.	Tries to fetch a page summary:
GET /api/rest_v1/page/summary/{topic}?redirect=true
2\.	If not found (404), performs a quick search:
GET /w/api.php?action=opensearch\&format=json\&limit=1\&search={topic}
and retries the summary using the best match.
3\.	Always returns a predictable JSON with status:
•	FOUND — summary resolved
•	NOT_FOUND — page not found (run still SUCCEEDED)

Input

{
"topic": "Web scraping"
}

Parameter
•	topic (string, required) — article subject/title (any language). Redirects handled via redirect=true; Wikipedia may normalize the title.

Output

Example: FOUND

{
"input_topic": "Web scraping",
"status": "FOUND",
"resolved_title": "Web scraping",
"url": "https://en.wikipedia.org/wiki/Web_scraping",
"title": "Web scraping",
"extract": "Web scraping is data scraping used for extracting data from websites...",
"lang": "en",
"timestamp": "2025-09-11T03:00:00.000Z"
}

Example: NOT_FOUND

{
"input_topic": "Apify",
"status": "NOT_FOUND",
"resolved_title": null,
"url": null,
"title": null,
"extract": null,
"lang": "en",
"timestamp": "2025-09-11T03:00:00.000Z"
}

Fields
•	input_topic — original input value
•	status — FOUND | NOT_FOUND
•	resolved_title — normalized page title (if found)
•	url — canonical desktop URL
•	title — page title
•	extract — short summary
•	lang — summary language (usually en)
•	timestamp — ISO time of result creation

How to run
1\.	Click Run and provide input, e.g.:

{"topic": "New York City"}

```
2.	Results:
•	Dataset — records list
•	Key-Value Store → OUTPUT.json — final JSON
•	Logs show Resolved ... on success or a warning on NOT_FOUND
```

Performance & resources
•	Runtime: 0.2–1.2 s/run
•	Memory: 256–512 MB is enough
•	Cost: negligible on start; depends on your Apify plan
•	Concurrency: safe to run in parallel; actor doesn’t use sessions or cookies

Fair use & limitations
•	Uses only public Wikipedia endpoints
•	No auth/captcha/paywall bypass of any kind
•	Designed for short summaries; full HTML parsing is out of scope

Typical use cases
•	Entity enrichment (technologies, companies, cities) with short blurbs
•	Search UIs: preview cards, snippet generation
•	Pre-normalization of terms before downstream processing

Sample inputs

{"topic": "Python (programming language)"}

{"topic": "Moscow"}

{"topic": "Large language model"}

Error handling
•	Non-200 HTTP statuses do not crash the run: status: NOT_FOUND is returned
•	Unexpected exceptions are logged and serialized into OUTPUT (not expected in normal use)

Versioning & stability
•	Semantic versions: MAJOR.MINOR.PATCH
•	Output schema changes only in MAJOR releases

Support
•	Feedback: comments on finished runs (Actor Runs → Logs/Comments)
•	SLA: 1 business day (UTC)

License & legal
•	Data comes from public Wikipedia APIs; comply with Wikipedia content licensing for downstream use
•	Actor doesn’t collect or process personal data

Changelog (short)
•	0.1.0 — initial public release: REST summary + search fallback, deterministic success, stable JSON.

Tags: wikipedia, summary, api, knowledge, entity-enrichment, no-scraping

⸻

Wikipedia Summary (API-first) — RU

Кратко: по входному topic актёр вызывает официальное REST-API Википедии и возвращает структурированную выжимку (заголовок, аннотацию, канонический URL). Если страницы нет, актёр не падает: завершает работу со статусом SUCCEEDED и status: NOT_FOUND.
•	Надёжен для автоматизации и iPaaS-пайплайнов
•	Без HTML-скрейпинга и обходов защиты — только публичные API Википедии
•	Быстрый отклик (обычно 0.2–1.2 с/запуск), минимальные ресурсы

Что делает актёр
1\.	Пытается получить сводку страницы:
GET /api/rest_v1/page/summary/{topic}?redirect=true
2\.	Если не найдено (404), выполняет быстрый поиск:
GET /w/api.php?action=opensearch\&format=json\&limit=1\&search={topic}
и повторно запрашивает сводку по лучшему совпадению.
3\.	Всегда возвращает предсказуемый JSON с status:
•	FOUND — сводка получена
•	NOT_FOUND — статья не найдена (ран SUCCEEDED)

Вход

{
"topic": "Web scraping"
}

Параметр
•	topic (string, required) — тема/заголовок статьи (любой язык). Редиректы обрабатываются redirect=true; Википедия может нормализовать заголовок.

Выход

Пример: найдено

{
"input_topic": "Web scraping",
"status": "FOUND",
"resolved_title": "Web scraping",
"url": "https://en.wikipedia.org/wiki/Web_scraping",
"title": "Web scraping",
"extract": "Web scraping is data scraping used for extracting data from websites...",
"lang": "en",
"timestamp": "2025-09-11T03:00:00.000Z"
}

Пример: не найдено

{
"input_topic": "Apify",
"status": "NOT_FOUND",
"resolved_title": null,
"url": null,
"title": null,
"extract": null,
"lang": "en",
"timestamp": "2025-09-11T03:00:00.000Z"
}

Поля
•	input_topic — исходное значение
•	status — FOUND | NOT_FOUND
•	resolved_title — нормализованный заголовок (если найден)
•	url — канонический desktop-URL
•	title — заголовок страницы
•	extract — краткая аннотация
•	lang — язык сводки (обычно en)
•	timestamp — время формирования результата (ISO)

Как запустить
1\.	Нажмите Run и укажите вход, например:

{"topic": "New York City"}

```
2.	Результаты:
•	Dataset — записи,
•	Key-Value Store → OUTPUT.json — финальный JSON,
•	В логах — Resolved ... при успехе или предупреждение при NOT_FOUND.
```

Производительность и ресурсы
•	Время: 0.2–1.2 с/запуск
•	Память: 256–512 MB достаточно
•	Себестоимость: минимальна; зависит от тарифа Apify
•	Параллельность: безопасно; актёр не использует сессии/куки

Ограничения и fair use
•	Используются только публичные эндпоинты Википедии
•	Нет обхода авторизаций/капч/paywall
•	Предназначен для кратких сводок; полный HTML вне рамок

Типовые сценарии
•	Обогащение сущностей (технологии, компании, города) короткими описаниями
•	Поисковые витрины: превью-карточки, сниппеты
•	Пред-нормализация терминов перед дальнейшей обработкой

Примеры входа

{"topic": "Python (programming language)"}

{"topic": "Moscow"}

{"topic": "Large language model"}

Обработка ошибок
•	HTTP-статусы ≠200 не вызывают падения: возвращается status: NOT_FOUND
•	Непредвиденные исключения логируются и сериализуются в OUTPUT (в штатном режиме не ожидаются)

Версионирование и стабильность
•	Семантические версии: MAJOR.MINOR.PATCH
•	Изменения схемы выхода — только в MAJOR

Поддержка
•	Обратная связь: комментарии к выполненным ранам (Actor Runs → Logs/Comments)
•	SLA: 1 рабочий день (UTC)

Лицензия и право
•	Данные из публичных API Википедии; соблюдайте лицензию контента Википедии при дальнейшем использовании
•	Актёр не собирает и не обрабатывает персональные данные

Changelog (кратко)
•	0.1.0 — первый публичный релиз: REST-summary + поиск, детерминированное завершение, стабильный JSON.

Теги: wikipedia, summary, api, knowledge, entity-enrichment, no-scraping

# Actor input Schema

## `topic` (type: `string`):

Название статьи en.wikipedia.org/wiki/<topic>

## Actor input object example

```json
{
  "topic": "Apify"
}
```

# 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("adaptable_initiative/my-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("adaptable_initiative/my-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 adaptable_initiative/my-actor --silent --output-dataset

```

## MCP server setup

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