✅ Free to use! 📖 A simple Node.js wrapper to fetch Wikipedia summaries in multiple languages.
npm install wikipedia-summary
✅ Fetches Wikipedia summaries easily.
✅ Supports multiple languages (en
, tr
, fr
, de
, etc.).
✅ Returns title, description, extract, page URL, and image.
✅ Lightweight and easy to use.
const { getSummary } = require("wikipedia-summary");
async function main() {
const summary = await getSummary("Albert Einstein", "en");
console.log(summary);
}
main();
Fetches a short summary from Wikipedia.
Parameters:
-
topic
(string): The topic to search for. -
language
(string, optional): Wikipedia language code (default:"en"
).
Returns:
A JSON object with:
-
title
: The page title. -
description
: A short description. -
extract
: A brief summary. -
pageUrl
: The Wikipedia page link. -
imageUrl
: The main image of the page (if available).
This project is licensed under the MIT License.
- GitHub Issues: Report Bugs or Request Features
- Give a Star: ⭐ If you love this package, show some support!
🚀 Now go explore the world of knowledge! 🌍