Skip to content

Wikipedia

The Wikipedia component lets you search Wikipedia and retrieve articles or snippets that you can then use in your automation tasks. It connects to the public Wikipedia API, pulls the requested pages, and gives you the results in a format that other components can work with.

How it Works

When you run the component, it creates a Wikipedia API wrapper that talks to Wikipedia’s public API.

  1. Search – It sends your search query (the Input field) to Wikipedia.
  2. Retrieve – It pulls the top Number of results pages in the language you choose.
  3. Trim – If you set Document content characters max, it limits the amount of text returned for each page.
  4. Return – The component returns two kinds of outputs:
    • Data – A list of Data objects that contain the article titles, snippets, and any metadata you requested.
    • Tool – A reusable Tool that can be added to other parts of your workflow for repeated Wikipedia queries.

No extra operations are available; the component always performs the same search‑and‑return action.

Inputs

  • Document content characters max: Set the maximum number of characters to return from each Wikipedia article. A lower number speeds up the response but gives less detail.
  • Input: The search term or phrase you want to look up on Wikipedia.
  • Number of results: How many top results you want to retrieve.
  • Language: The language code (e.g., en for English, es for Spanish) that tells Wikipedia which language version to query.
  • Load all available meta: If checked, the component will also pull all available metadata (like page ID, revision ID, etc.) for each article.

Outputs

  • Data: A list of Data objects, each representing a Wikipedia article or snippet that matches your query.
  • Tool: A Tool object that can be used elsewhere in your workflow to perform the same Wikipedia query again.

Usage Example

  1. Drag the Wikipedia component onto your canvas.
  2. In the Input field, type Artificial Intelligence.
  3. Set Number of results to 4.
  4. Keep Language as en.
  5. Leave Document content characters max at the default 4000.
  6. Run the workflow.

The component will return four Data objects containing the titles and summaries of the top Wikipedia pages about Artificial Intelligence. You can then feed these Data objects into a summarizer, a display component, or any other part of your automation.

  • WikipediaBaseTool – A lower‑level tool that can be used when you need more control over the Wikipedia query.
  • WikipediaAPIWrapper – The underlying library that handles the API calls; useful if you want to see the raw API requests.

Tips and Best Practices

  • Use a smaller Number of results for faster responses, especially in large workflows.
  • Adjust Document content characters max to keep the data size manageable.
  • If you only need the article title, set Load all available meta to False to reduce payload.
  • Combine the Wikipedia component with a text summarizer to create concise knowledge cards.

Security Considerations

Wikipedia is a public, open API, so the data retrieved is not sensitive. However, always validate the content before using it in downstream processes, especially if the data will be displayed to end users or stored in a database.