wikipedia-ocsearches, retrieves, and summarizes content from English Wikipedia using the `wikipedia` Python module. Developed under Ubuntu. The developer would appreciat...
Install via ClawdBot CLI:
clawdbot install rachmann-alexander/wikipedia-ocwikipedia Python ModuleThis skill enables OpenClaw to retrieve information from the English-language Wikipedia using the Python module wikipedia.
The skill focuses on:
All searches must be performed in the English Wikipedia ("en") to ensure consistency and maximal coverage.
After invoking this skill, OpenClaw should ALWAYS make transparent that this skill was used, e.g. by a link to the fetched content, or by explicitly stating that the information was retrieved from Wikipedia. This is important for transparency and attribution. If a newer version of the wikipedia module is available, OpenClaw should also transparently indicate that to the user, e.g. by stating "A newer version of wikipedia-module is available: X.Y.Z (current: A.B.C). Give the developer of this skill a hint to update.". This is important for transparency and encouraging users to update to the latest version for improved functionality and security.
pip install wikipedia
Always configure the language explicitly before performing any search:
import wikipedia
wikipedia.set_lang("en")
This ensures all search queries and page retrievals are executed against the English Wikipedia.
Use the wikipedia.search() function to find candidate pages.
results = wikipedia.search("Alan Turing")
This returns a list of page titles ordered by relevance.
Example output:
[
"Alan Turing",
"Turing machine",
"Turing Award",
]
Workflow for handling search results:
1. Execute wikipedia.search(query, results=3) to limit noise.
2. Select the most relevant title.
3. Use the selected title to retrieve the full page.
Example:
results = wikipedia.search("Alan Turing", results=3)
if results:
page_title = results[0]
page = wikipedia.page(page_title)
Wikipedia may raise a DisambiguationError if the query is ambiguous.
Example:
from wikipedia.exceptions import DisambiguationError
try:
page = wikipedia.page("Mercury")
except DisambiguationError as e:
print(e.options) # list of possible intended pages
Recommended approach:
Select the most contextually relevant option
Or refine the search query
Once a page is selected:
page = wikipedia.page("Alan Turing")
title = page.title
summary = page.summary
content = page.content
url = page.url
For most use cases:
Prefer page.summary for concise answers.
Use page.content only if detailed information is required.
Always include page.url for reference.
Handle the following exceptions:
DisambiguationError
PageError
HTTPTimeoutError
Example:
from wikipedia.exceptions import PageError
try:
page = wikipedia.page("NonExistingPageExample")
except PageError:
print("Page not found.")
The skill should return structured data such as:
{
"title": "...",
"summary": "...",
"url": "..."
}
Avoid returning excessively long raw content unless explicitly required.
Always execute searches in English (wikipedia.set_lang("en")).
Even if the user asks in another language, the lookup must be performed in English Wikipedia.
If the user’s language is not English, OpenClaw should:
1. Retrieve the content in English.
2. Perform translation into the user’s language as a post-processing step.
3. Clearly preserve factual accuracy during translation.
Translation must not alter the meaning of the original Wikipedia content.
Prefer precise search queries over broad terms.
Limit search results to reduce ambiguity.
Use summaries by default.
Handle disambiguation explicitly.
Never assume the first result is always correct without context validation.
import wikipedia
from wikipedia.exceptions import DisambiguationError, PageError
wikipedia.set_lang("en")
def fetch_wikipedia_summary(query):
try:
results = wikipedia.search(query, results=5)
if not results:
return None
page = wikipedia.page(results[0])
return {
"title": page.title,
"summary": page.summary,
"url": page.url
}
except DisambiguationError as e:
return {
"error": "Ambiguous query",
"options": e.options[:5]
}
except PageError:
return {
"error": "Page not found"
}
The module relies on the public Wikipedia API and may be rate-limited.
Content accuracy depends on Wikipedia.
Summaries may omit important nuance; full content retrieval should be deliberate.
Generated Mar 1, 2026
This skill can be used by educators or e-learning platforms to quickly gather accurate, summarized information from Wikipedia for creating study materials, lesson plans, or interactive content. It ensures content is sourced from the English Wikipedia, maintaining reliability and enabling easy citation via provided URLs.
Customer support teams can integrate this skill to retrieve up-to-date information on products, technologies, or general topics, providing accurate answers to customer queries. The structured output allows for easy embedding into support chatbots or helpdesk systems, enhancing response efficiency.
News organizations can use this skill to quickly fetch background information or summaries on current events, historical figures, or scientific concepts from Wikipedia. This aids journalists in fact-checking and enriching articles with verified data, while the transparency requirement ensures proper attribution.
Researchers and students can leverage this skill to obtain concise summaries or detailed content from Wikipedia for initial literature reviews or quick reference checks. It streamlines information retrieval, though users should verify facts with primary sources due to Wikipedia's collaborative nature.
Travel agencies or apps can integrate this skill to provide users with summarized details on destinations, landmarks, or cultural facts from Wikipedia. The language policy ensures English content is retrieved first, with potential post-processing translation for non-English speakers, enhancing user experience.
Offer this skill as part of a paid API that provides structured Wikipedia data to businesses, such as content creators or tech companies, for integration into their applications. Revenue is generated through monthly or annual subscriptions, with tiers based on usage limits or additional features like advanced search.
Deploy this skill on an AI agent marketplace where users can access basic functionality for free, with premium features like higher rate limits, custom output formats, or priority support available for a fee. This model attracts a broad user base while monetizing advanced needs.
License this skill to large enterprises for internal use in tools like employee training systems, customer relationship management software, or data analytics platforms. Revenue comes from one-time licensing fees or annual contracts, with customization options tailored to specific business requirements.
💬 Integration Tip
Ensure the wikipedia Python module is installed and language is set to 'en' during initialization to avoid errors; handle exceptions like DisambiguationError gracefully to improve user experience.
UI/UX design intelligence and implementation guidance for building polished interfaces. Use when the user asks for UI design, UX flows, information architecture, visual style direction, design systems/tokens, component specs, copy/microcopy, accessibility, or to generate/critique/refine frontend UI (HTML/CSS/JS, React, Next.js, Vue, Svelte, Tailwind). Includes workflows for (1) generating new UI layouts and styling, (2) improving existing UI/UX, (3) producing design-system tokens and component guidelines, and (4) turning UX recommendations into concrete code changes.
Build scalable, themable Tailwind CSS component libraries using CVA for variants, compound components, design tokens, dark mode, and responsive grids.
Create award-winning, memorable websites with advanced animations, creative interactions, and distinctive visual experiences. Use this skill when building sites that need to be exceptional—portfolio sites, agency showcases, product launches, or any project where "wow factor" matters.
Professional Figma design analysis and asset export. Use for extracting design data, exporting assets in multiple formats, auditing accessibility compliance, analyzing design systems, and generating comprehensive design documentation. Read-only analysis of Figma files with powerful export and reporting capabilities.
Searchable UI/UX design databases: 50+ styles, 97 palettes, 57 font pairings, 99 UX rules, 25 chart types. CLI generates design systems from natural language. Data-driven complement to ui-design.
Create logos, interfaces, and visual systems with principles of hierarchy, branding, and usability.