# Wikipedia search

> Search English Wikipedia for matching pages.

Source: https://docs.tune.toys/nodes/addon.wikipedia.search/

Wikipedia search looks up pages on English Wikipedia by title and content. It needs no key.

## What it does

The node is generated from the `wikipedia` addon manifest. It requests `GET https://en.wikipedia.org/w/rest.php/v1/search/page?q=…&limit=…` and runs it like a [Web request](https://docs.tune.toys/nodes/web.request/). `response` is JSON with a `pages` list; each page has `id`, `key`, `title`, `excerpt`, `description` and, when there is one, a `thumbnail`.

The search terms come from the `q` port when cabled, otherwise from the node's `q` field. With `trigger` cabled each trigger searches; otherwise a change on a cabled port does; with no cable at all it searches once at start.

A Toy using this node requires the network and the `wikipedia` addon, enabled in Settings → Addons. Text is CC BY-SA 4.0.

## When to use it

Use it to find articles, then feed a page's `key` to [Wikipedia summary](https://docs.tune.toys/nodes/addon.wikipedia.summary/) or step through the results with [List](https://docs.tune.toys/nodes/data.list/).

## Ports

<!-- ports:start -->

| Port       | Direction | Signal         | Lanes |
| ---------- | --------- | -------------- | ----- |
| `trigger`  | Input     | Data (trigger) | 1     |
| `q`        | Input     | Data (string)  | 1     |
| `limit`    | Input     | Data (integer) | 1     |
| `response` | Output    | Data (json)    | 1     |
| `status`   | Output    | Data (integer) | 1     |
| `error`    | Output    | Data (string)  | 1     |
| `done`     | Output    | Data (trigger) | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label | Range    | Default | Unit | Scale  | Notes                                                            |
| --------- | ----- | -------- | ------- | ---- | ------ | ---------------------------------------------------------------- |
| `limit`   | Limit | 1 to 100 | 10      |      | linear | Most pages returned, 1 to 100. Used while the port has no cable. |

<!-- parameters:end -->

<!-- data:start -->

- `q`: text.

<!-- data:end -->

### Limit (`limit`)

The most pages returned, 1 to 100 (10 by default).

### Query

The `q` text field holds the search terms (up to 300 characters), used while the `q` port has no cable.

## Tips

- `excerpt` contains HTML highlight markup; use `title` or `description` for plain text.
- Pick the first title with [Convert](https://docs.tune.toys/nodes/data.convert/) and path `/pages/0/title`.

## See also

[Wikipedia summary](https://docs.tune.toys/nodes/addon.wikipedia.summary/), [Convert](https://docs.tune.toys/nodes/data.convert/), [List](https://docs.tune.toys/nodes/data.list/), [Data cables](https://docs.tune.toys/concepts/data-cables/).
