Wikipedia Lookup Skill
Search and read Wikipedia articles using the free API.
Search
curl -s "https://en.wikipedia.org/api/rest_v1/page/summary/{topic}" | python3 -m json.tool
Get Summary
curl -s "https://en.wikipedia.org/api/rest_v1/page/summary/{topic}" | python3 -c "
import json, sys
data = json.load(sys.stdin)
print(data.get('title', 'Not found'))
print()
print(data.get('extract', 'No summary available'))
"
Search for Topics
curl -s "https://en.wikipedia.org/w/api.php?action=opensearch&search={query}&limit=5&format=json" | python3 -m json.tool
Notes
- URL-encode topic names (replace spaces with underscores)
- The API is free, no key required
- Use for fact-checking and background research