DEV Community

Cover image for 📚 Meet denason/wikipedia – A Laravel package to talk to Wikipedia like a pro
mohammad asadi
mohammad asadi

Posted on • Edited on

📚 Meet denason/wikipedia – A Laravel package to talk to Wikipedia like a pro

در ادامه نسخه‌ی ویرایش‌شده و قالب‌بندی‌شده‌ی کامل برای نمایش صحیح (مخصوصاً در Markdown — مثلاً برای dev.to یا GitHub) ارائه می‌شود:


![Wikipedia Core for Laravel Devs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1n0cg1lf1f60fx34ilin.jpg)

---

# 📚 Meet `denason/wikipedia` – A Laravel package to talk to Wikipedia like a pro

Hey devs! 👋  
Ever wanted to pull some info from Wikipedia into your Laravel app without fighting their raw API?  
Let me introduce you to [`denason/wikipedia`](https://github.com/denason/wikipedia) – a clean, expressive, and flexible package that makes working with Wikipedia super smooth 🚀

---

## 🔧 What does it do?

This package gives you an elegant Laravel-style wrapper around the Wikipedia REST API.  
You can easily grab:

- ✅ Article summaries  
- ✅ Full HTML content  
- ✅ Raw wikitext  
- ✅ Article images  
- ✅ Infobox-style data  
- ✅ Categories  
- ✅ Multilingual support  
- ✅ Search results  

And it’s just a couple lines of code away.

---

## ⚡️ Quick Installation

```

bash
composer require denason/wikipedia


Enter fullscreen mode Exit fullscreen mode

🧪 Code Examples

Get a summary:


php
Wikipedia::summary('Laravel');


Enter fullscreen mode Exit fullscreen mode

Grab the main image:


php
Wikipedia::image('Albert Einstein');


Enter fullscreen mode Exit fullscreen mode

Full HTML version of a page:


php
Wikipedia::html('Iran');


Enter fullscreen mode Exit fullscreen mode

Search Wikipedia:


php
Wikipedia::search('PHP frameworks');


Enter fullscreen mode Exit fullscreen mode

Use another language:


php
Wikipedia::lang('fa')->summary('تهران');


Enter fullscreen mode Exit fullscreen mode

😎 Why use it?

  • No need to mess with URLs or HTTP clients
  • Simple, expressive API using Laravel facades
  • Fully extendable
  • Great for bots, dashboards, content tools, and more

💭 What’s next?

This is just part one of a bigger idea.
I’m also working on:

  • 📦 A Laravel wrapper for Wikidata (with SPARQL)
  • 🤖 An AI-enhanced package to analyze, summarize, and graph Wikipedia/Wikidata content

So if this sounds cool:

👉 Drop a ⭐️ on the GitHub repo
👉 Try it out in your next project
👉 And stay tuned for what’s coming next!


Made with ☕️ by Mohammad Asadi




---



Enter fullscreen mode Exit fullscreen mode

Top comments (0)