--- id: wikipedia-api version: "0.15.0" license: MIT license_treatment: permissive maintenance: active --- # Wikipedia-API — Python Wrapper for Wikipedia License: permissive · Maintenance: active · Downloads: 19.1M/mo ## What it is and what it does Wikipedia-API wraps Wikipedia's MediaWiki API to let you programmatically fetch and parse Wikipedia pages. It provides both a synchronous Wikipedia client and an asynchronous AsyncWikipedia client, so you can choose blocking or non-blocking I/O depending on your application's needs. You initialize a client with a user-agent string and language code, then call .page() to retrieve a page object. From there you can access the page's summary, full text, sections with recursion support, links, categories, translations, and metadata like URLs and page IDs. The library handles underlying HTTP requests via httpx and uses tenacity for retry logic. The synchronous API returns data directly from properties like page.summary and page.text, while the async API makes those same properties awaitable coroutines. Both APIs support extracting text in wiki markup or HTML format. The library is actively maintained, supports Python 3.10 and later, and has no known security vulnerabilities. Use it for: - Scrape Wikipedia summaries and full article text for knowledge base or research tools - Build a chatbot or Q&A system that retrieves Wikipedia content to answer user queries - Extract page sections and structure for content analysis or document processing pipelines - Fetch Wikipedia links and categories to build knowledge graphs or topic relationship maps - Integrate Wikipedia data into async applications without blocking the event loop ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wikipedia-API is a Python wrapper for Wikipedia's MediaWiki API that retrieves page content, sections, links, categories, and metadata in both synchronous and asynchronous modes. Yes. The package is actively maintained, has no security vulnerabilities, uses a permissive MIT license, and installs with low friction. It's well-suited for any project that needs to programmatically access Wikipedia content. The dual sync/async API design makes it flexible for both simple scripts and production async applications. ## Install pip install wikipedia-api uv add wikipedia-api poetry add wikipedia-api ## Installing Wikipedia-API Before you install: Low friction install with three lightweight runtime dependencies (click, httpx, tenacity). Active maintenance with a recent release 80 days ago and 746 repository stars. Requires Python 3.10 or later. License in practice: MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install wikipedia-api import wikipediaapi wiki = wikipediaapi.Wikipedia(user_agent='MyProject (contact@example.com)', language='en') page = wiki.page('Python_(programming_language)') print(page.summary) Requires Python 3.10 or later; user-agent must include contact information per Wikimedia Foundation policy. Verify before relying: - Rate limiting or throttling behavior when making repeated Wikipedia API calls - Handling of Wikipedia redirects and disambiguation pages - Performance characteristics for large-scale batch page retrieval ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 19.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags wikipedia api wrapper python, fetch wikipedia page content, wikipedia async client, extract wikipedia text sections, wikipedia page metadata retrieval, mediawiki api python wrapper, wikipedia page summary extraction, wikipedia-integration, async-support, web-scraping [View on SkillFed](https://skillfed.io/packages/wikipedia-api) · [View on PyPI](https://pypi.org/project/wikipedia-api/)