Search⌘ K
AI Features

Wikipedia

Explore how to access and query Wikipedia data using the Python wikipedia package. Learn to search articles, retrieve summaries, handle disambiguation and page errors, and switch languages to work with Wikipedia content effectively.

Wikipedia is free crowd-sourced encyclopedia. It is constantly updated and has millions of articles.

Wikipedia also has a simple API that’s been wrapped for Python in the wikipedia package.

Getting started

Let’s install it and see how we might use it!

Javascript (babel-node)
pip3 install wikipedia

The wikipedia package depends on BeautifulSoup and the requests package. Fortunately, it will install them or upgrade them itself if they are missing or out-of-date. ...