K
Docs
🌐

Look Up on Wikipedia

info.wikiThe AlmanacLook-ups

Searches Wikipedia and brings back the best article: its title, a short summary, a one-line description, a picture and the link. Disambiguation pages are skipped, so “Mercury” lands on a real article. Pick another language to search that Wikipedia instead.

When to use this
  • →{{wiki.summary}} fits in a Reply; Send an Embed with {{wiki.image}} makes it look sharp
  • →{{wiki.description}} is a one-liner like “English computer scientist (1912–1954)”

On the canvas

This is what Look Up on Wikipedia looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🌐
Look Up on Wikipedia
info.wiki
Look-ups
queryrequired
e.g. {{input.options.topic}}
lang
select…
asrequired
wiki
found
missing
error

Config fields

FieldTypeReqWhat it does
query
e.g. {{input.options.topic}}
textyesWhat to look up 🔎
langselect—Which Wikipedia 🗣️
as
wiki
textyesSave it as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{wiki.title}}stringThe article's title
{{wiki.summary}}stringThe first paragraphs, ready to send
{{wiki.description}}stringA one-liner like “English computer scientist (1912–1954)”
{{wiki.url}}stringLink to the article
{{wiki.image}}stringLink to its main picture (empty when it has none)
{{wiki.query}}stringWhat was looked up
{{wiki.error}}stringWhy it couldn't be looked up

Output ports

foundThe article is in your spark — {{wiki.summary}}, {{wiki.url}}
missingNothing matched — {{…query}} says what they asked for
errorCouldn't ask right now (busy or down) — {{…error}} says why
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const url = new URL("https://en.wikipedia.org/w/api.php");
url.search = new URLSearchParams({
  action: "query", format: "json", formatversion: "2", generator: "search",
  gsrsearch: topic, gsrlimit: "1", prop: "extracts|pageimages|info",
  exintro: "1", explaintext: "1", inprop: "url",
}).toString();
const page = (await (await fetch(url)).json()).query?.pages?.[0];
// page.extract → {{wiki.summary}}, page.fullurl → {{wiki.url}} — or Missing ∅