Queries the Wikipedia API for article summaries and search results. Follows Wikimedia API etiquette guidelines including proper User-Agent identification.
- Python 3
requestslibrary
- Clone the repo
git clone https://github.com/CrustyBarnacle/Wiki_Search.git # or via SSH or `gh` cli- Create Python Environment
python3 -m venv .wiki_venv # or whatever you want to name it- Install dependencies
pip install requests# Get summary for exact title
./wiki_search_1.0.py "Python programming" | "Psychology"
# Search for articles
./wiki_search_1.0.py -s "machine learning" | "poetry"
# Get full article extract
./wiki_search_1.0.py -f "Albert Einstein" | "Ada Lovelace"
# Search Spanish Wikipedia
./wiki_search_1.0.py -l es "España"| Option | Description |
|---|---|
-l, --language |
Wikipedia language code (default: en) |
-s, --search |
Search for articles instead of direct lookup |
-f, --full |
Get full article instead of summary |
-n, --limit |
Number of search results, 1-50 (default: 5) |
- Page Summary: Get the introduction/summary of a Wikipedia article by title
- Article Search: Search Wikipedia for articles matching a query
- Full Extract: Get the complete article text (not just intro)
- Multi-language: Support for any Wikipedia language edition
- Proper API Etiquette: Includes required User-Agent header per Wikimedia policy