Wikipedia search
Search English Wikipedia for matching pages.
- Web
- Since 0.2.0
- addon
- wikipedia
- search
- pages
- text
- web
- data
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. 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 or step through the results with List.
Ports#
| 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 |
Parameters#
| 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. |
q: text.
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#
excerptcontains HTML highlight markup; usetitleordescriptionfor plain text.- Pick the first title with Convert and path
/pages/0/title.
See also#
Wikipedia summary, Convert, List, Data cables.
Help patches
Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.
1. Search for instruments
beginner Teaches: limit
Wikipedia search returns matching pages; Convert picks the first title.
Connections as text
- Wikipedia search response output connected to Convert value input
- Convert value output connected to Console log value input
- Limit caps the pages returned; each has id, key, title, excerpt and description.
Related nodes
- Wikipedia summary Lead extract of an English Wikipedia article.
- Convert Convert a value to another datatype, optionally picking a field or formatting a string; failures go to error.
- List List operations on data values: get, push, insert, remove, slice, sort, unique, flatten, join, range, sum, minimum, maximum, mean, shuffle and more.