PHPackages                             divineomega/php-wikipedia-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. divineomega/php-wikipedia-search

Abandoned → [jord-jd/php-wikipedia-search](/?search=jord-jd%2Fphp-wikipedia-search)Library[Utility &amp; Helpers](/categories/utility)

divineomega/php-wikipedia-search
================================

PHP Wikipedia Search

v1.1.0(1mo ago)41072LGPL-3.0-onlyPHPPHP &gt;=7.1CI passing

Since Feb 14Pushed 1mo agoCompare

[ Source](https://github.com/Jord-JD/php-wikipedia-search)[ Packagist](https://packagist.org/packages/divineomega/php-wikipedia-search)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-php-wikipedia-search/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

PHP Wikipedia Search
====================

[](#php-wikipedia-search)

Search Wikipedia editions through the current MediaWiki Action API and receive normalized, serializable result objects.

Installation
------------

[](#installation)

```
composer require jord-jd/php-wikipedia-search
```

Usage
-----

[](#usage)

```
use JordJD\WikipediaSearch\Enums\Languages;
use JordJD\WikipediaSearch\WikipediaSearcher;

$searcher = new WikipediaSearcher(Languages::ENGLISH);
$results = $searcher->search('PHP programming language', [
    'limit' => 25,
    'namespaces' => [0],
    'what' => 'text',
]);

foreach ($results as $result) {
    echo $result->getTitle();
    echo $result->getDescription();
    echo $result->getUrl();
    echo $result->getPageId();
    echo $result->getWordCount();
    echo $result->getTimestamp();
    echo json_encode($result);
}
```

The enum contains common Wikipedia language editions, but any valid Wikipedia language subdomain such as `simple` or `zh-min-nan` can be supplied.

Supported options follow MediaWiki's official [`list=search` documentation](https://www.mediawiki.org/wiki/API:Search): `limit` (1 to 500), `offset`, `namespaces`, and `what` (`text`, `title`, or `nearmatch`). Invalid values fail before an HTTP request is made.

Use `getContinueOffset()` as the next request's `offset`. The searcher also exposes `getTotalHits()`, `getSuggestion()`, and `getRewrittenQuery()` from the API response.

Custom HTTP transport
---------------------

[](#custom-http-transport)

The optional second constructor argument is a callable receiving the URL, headers, and timeout. It must return the response body as a string:

```
$searcher = new WikipediaSearcher(
    Languages::ENGLISH,
    function (string $url, array $headers, int $timeout): string {
        return $yourHttpClient->get($url, $headers, $timeout);
    },
    10,
    'your-application/1.0 (https://example.com/contact)'
);
```

The package supports PHP 7.1 through current PHP 8.x releases.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~153 days

Total

2

Last Release

30d ago

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

v1.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (10 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divineomega-php-wikipedia-search/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-php-wikipedia-search/health.svg)](https://phpackages.com/packages/divineomega-php-wikipedia-search)
```

###  Alternatives

[systemcode/brazilcustomerattributes

Brazilian customer identity using Magento native taxvat and name fields.

6014.2k](/packages/systemcode-brazilcustomerattributes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
