# Wikipedia Search API & Scraper: Articles and Extracts (`publicrecords/wikipedia-search`) Actor

Wikipedia search and Wikipedia API for article titles, URLs, extracts or full text. Also fetches ECB euro exchange rates and U.S. Treasury par yields. Public sources only.

- **URL**: https://apify.com/publicrecords/wikipedia-search.md
- **Developed by:** [Public Records](https://apify.com/publicrecords) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 wikipedia, fx or treasury rows

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/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 Search, ECB Exchange Rates & Treasury Yields

Search Wikipedia and return article titles, URLs and extracts; fetch ECB euro foreign-exchange reference rates; or read the U.S. Treasury par yield curve. Public sources only. No outside AI API.

Who it is for: researchers and agents that need a Wikipedia article extract, a euro foreign-exchange snapshot, or a U.S. Treasury par-yield snapshot from public sources.

### Wikipedia search

In `wiki` mode, send a search query and an optional language edition (default en). Each row is an article with title, URL, last edited time, an extract, and the CC BY-SA licence line. Turn on Full article when you need the page text instead of the intro.

### Exchange rates and Treasury yields

In `fx` mode, the Actor reads ECB euro reference rates (optional date, symbols and an amount to convert). In `treasury` mode, it reads the U.S. Treasury par yield curve for a date.

### Default input

```json
{
  "mode": "wiki",
  "q": "European Central Bank",
  "limit": 2
}
```

### Sample output

A real Apify run of the prefilled Wikipedia search on 2026-11-25 returned 2 rows. The first row was:

```json
{
  "title": "European Central Bank",
  "url": "https://en.wikipedia.org/wiki/European_Central_Bank",
  "last_edited": "2026-11-24T16:46:26Z",
  "extract": "The European Central Bank (ECB) is the central component of the Eurosystem and the European System of Central Banks (ESCB) as well as one of seven institutions of the European Union. It is one of the world's most important central banks, heading a system with a combined balance sheet of close to €7 trillion.",
  "license": "Text from Wikipedia, CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/); attribute the linked article."
}
```

(Extract shortened here; the run stored the full intro.) The second row was "President of the European Central Bank". This sample is from Apify run WXD3vgdArPhNMscVG (build 0.1.5, 2026-11-25, America/Toronto).

### Pricing

Pay per event: one start fee per run, then a charge only for successful rows written to your dataset.

| Event | Price |
|---|---|
| Actor start (per GB of memory; default 256 MB = 1 start event, $0.001) | $0.001 |
| Successful Wikipedia, FX or Treasury row | $0.001 |

Examples: the prefilled two-article search costs $0.003 ($0.001 start + $0.001 per row). An ECB rates row or a Treasury curve row is also $0.001 after the start fee. An empty query (run KiYouan8h4SK2hlp3) returned 0 rows and was charged the start fee only.

Skipped inputs add no charge; the start fee still applies once per run. A run that returns 0 rows (empty query or a source outage) is not charged per row.

### Limits

- Wikipedia: up to 10 articles per run (Limit, default 2), or 3 with Full article on. Intros are cut at 4,000 characters, full articles at 60,000.
- FX rates come from the ECB euro reference feed; Treasury yields come from the U.S. Treasury par-yield publication. ECB reference rates are published for information purposes only, and the ECB discourages using them for transactions. They update once per working day. A date returns the latest rates or curve on or before that date; Treasury lookups stay within that calendar year.
- If a source is unreachable, the run succeeds with 0 rows and a reason in OUTPUT.
- Skipped inputs add no charge; the start fee still applies.

### What each field means

- Wikipedia rows: `title`, `url`, `last_edited`, `extract`, `license`
- FX rows: date, base, rates, amount and converted (when you send an amount), source, notice
- Treasury rows: date, units (percent), curve by tenor, spreads (10y_2y, 10y_3m), source

### FAQ

**Can I use this as a general web search?**

No. Wikipedia mode searches Wikipedia only. FX and Treasury modes read those public official feeds.

**What licence is the Wikipedia text under?**

CC BY-SA 4.0. Each row includes a licence line; attribute the linked article.

**What if Wikipedia is down?**

The run succeeds with 0 rows and a reason. You are not charged for a row. The start fee still applies.

**What if I send a field name this Actor does not use?** If none of the fields you send is one listed under Input, the run ends as SUCCEEDED with 0 rows and the status message names the unknown field; only the start fee is charged. An empty input runs the example input shown under Input. Common alternative names are read as the documented field, for example `query` as `q`.

**Can I call it from code or an AI agent?** Yes. Call it through the Apify API with your Apify token, or add it to an agent through Apify's MCP server (mcp.apify.com), and read the dataset rows.

### Licences

Wikipedia text is CC BY-SA 4.0 (attribute the linked article). ECB and U.S. Treasury publications are official public data. Source: European Central Bank. The ECB euro reference rates may be obtained free of charge through https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html; every `fx` row repeats this in its `notice` field. Cross rates (non-EUR base) and converted amounts are computed by this Actor from the ECB rates, not published by the ECB. The HTTP client is native Node fetch. The Apify SDK is Apache-2.0.

# Actor input Schema

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

Wikipedia search, ECB euro exchange rates, or U.S. Treasury par yields.

## `q` (type: `string`):

Article search (mode=wiki).

## `lang` (type: `string`):

Wikipedia language edition, default en.

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

Wikipedia result cap, 1-10.

## `full` (type: `boolean`):

Return full article text instead of the intro.

## `date` (type: `string`):

YYYY-MM-DD for a historical FX or Treasury snapshot.

## `base` (type: `string`):

ISO currency, default EUR.

## `symbols` (type: `string`):

Optional comma-separated currency codes, for example USD,GBP,JPY.

## `amount` (type: `number`):

Optional amount to convert from the base currency.

## Actor input object example

```json
{
  "mode": "wiki",
  "q": "European Central Bank",
  "lang": "en",
  "limit": 2,
  "full": false,
  "base": "EUR"
}
```

# Actor output Schema

## `rows` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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 = {
    "mode": "wiki",
    "q": "European Central Bank",
    "limit": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords/wikipedia-search").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 = {
    "mode": "wiki",
    "q": "European Central Bank",
    "limit": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords/wikipedia-search").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 '{
  "mode": "wiki",
  "q": "European Central Bank",
  "limit": 2
}' |
apify call publicrecords/wikipedia-search --silent --output-dataset

```

## MCP server setup

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

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/e40yWa176lqqzjVRp/builds/5pbUcJn4DwCwLrbSs/openapi.json
