Spiral gives your agent every tool with one account. Browse the tools →

opencode · Web

How to Use Wikipedia article text in opencode

Fetch a Wikipedia article's current text as wikitext or HTML, with article metadata. Use it to read the full article or inspect categories and redirects that structured article output leaves out.

Prompts to try with Wikipedia article text in opencode

Copy an example into opencode, or ask in your own words.

Use Wikipedia article text to retrieve English Wikipedia's Plate tectonics article and build a glossary draft in this project's documentation from terms explained in the article.

Wikipedia article textopencode
Try asking
  • Use Wikipedia article text to retrieve English Wikipedia's International Space Station article and add its text as a source document for this project's reference assistant.

  • Use Wikipedia article text to look this up and give me the result as a table. Save the result in ./assets.

  • Pull the latest numbers from Wikipedia article text and tell me what changed since last week.

  • Check Wikipedia article text and summarize what you find in three bullet points.

How to set up Wikipedia article text in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Wikipedia article text

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "alexandria",
        "model": "wikipedia/articles/lookup",
        "input": {
          "name": "<name>"
        }
      }'

Then paste one of the prompts above: opencode finds Wikipedia article text on Spiral, shows the price and runs it.

Wikipedia article text providers and prices

Spiral runs Wikipedia article text through Alexandria. Open a card for today's price, with every fee included.

AlexandriaWeb
Wikipedia · Article
wikipedia/articles/lookup

Settings you can ask for

Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Bodywikitext, html, both, or nonewikitext

Which article_body format to include when fields is not given: wikitext (default, compact), html (MediaWiki DOM, often 5-10x larger), both, or none for metadata and abstract only.

Limit1 to 101

Most matching articles to return, 1 to 10. More than one only helps when no project is pinned and the title exists on several wikis.

Every API field of Wikipedia · Article is on its tool page: open its card above.

What can you do with Wikipedia article text in opencode?

Build a reference feature from selected Wikipedia articles in your project. A coding agent can turn article text into searchable passages or work with parsed sections and tables for extraction.

Prepare a research brief

Read the Wikipedia articles for Lithium iron phosphate battery and Sodium-ion battery, then compare the advantages and limitations described in their text. Use parsed sections when extracting passages and full article text when more context is needed.

Build city background notes

Turn the articles for Chicago and Toronto into separate notes on history, geography, and transportation. Keep each statement tied to the article it came from.

Research public organizations

Use the NASA and European Space Agency articles to draft an organizational background comparison from the retrieved text. Distinguish what each article states from your own interpretation.

Create teaching materials

Read the Plate tectonics article and turn its explanations into a lesson outline, vocabulary list, and comprehension questions. Use the article's sections to keep the material organized.

Build a focused reference collection

Retrieve a chosen list of Wikipedia titles for a reference assistant. Store article passages from the text response or parsed sections from the structured response, with their source articles.

Report changes to selected articles

Retrieve the International Space Station article each day and compare it with your previously saved response. Summarize changes in the article's wording without presenting them as independently confirmed events.

Questions about Wikipedia article text in opencode

Can opencode use Wikipedia article text?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Wikipedia article text like any built-in tool.

How much does Wikipedia article text cost in opencode?

Up to $0.001746 per run at the default inputs. $0.001746 per unit of `limit`. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need an Alexandria account to use Wikipedia article text in opencode?

No. Spiral runs Wikipedia article text on its own Alexandria account. You sign in to Spiral once and never paste a key.

How long does it take to set up Wikipedia article text in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while Wikipedia article text runs?

Wikipedia article text runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

Can I search Wikipedia by topic with these lookups?

Both lookups require an exact article title. A request for a broad topic does not produce a ranked list of related articles.

How fresh is the article data?

Wikimedia documents these lookups as returning the current article revision. The revision identifier changes with every edit, so repeated retrievals can establish whether the article has changed.

Can I retrieve an article as it appeared last year?

These lookups return the current revision rather than a selectable historical revision. They do not provide a full revision-history download.

Why can an article title match more than once?

Article titles are not unique across Wikimedia projects. The same name can match pages on different wikis, so the intended source edition matters.

Does structured output include everything in the text response?

Structured Contents separates article content into parsed objects but omits the raw article body, categories, templates, and redirects. Use Wikipedia article text when those are necessary.

Get started

Start using Wikipedia article text in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options