PHPackages                             divineomega/wikipedia-info-box-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. divineomega/wikipedia-info-box-parser

Abandoned → [jord-jd/wikipedia-info-box-parser](/?search=jord-jd%2Fwikipedia-info-box-parser)Library[Parsing &amp; Serialization](/categories/parsing)

divineomega/wikipedia-info-box-parser
=====================================

Parses the info boxes on Wikipedia pages into an associative array

v6.0.0(6mo ago)5551LGPL-3.0-onlyPHPPHP &gt;=7.1CI passing

Since Jan 9Pushed 4w agoCompare

[ Source](https://github.com/Jord-JD/wikipedia-info-box-parser)[ Packagist](https://packagist.org/packages/divineomega/wikipedia-info-box-parser)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-wikipedia-info-box-parser/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (2)Versions (11)Used By (0)

Wikipedia Infobox Parser
========================

[](#wikipedia-infobox-parser)

Parse a Wikipedia article's first matching infobox into an associative array, including complete category and article-link lists.

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

[](#installation)

```
composer require jord-jd/wikipedia-info-box-parser
```

Usage
-----

[](#usage)

```
use JordJD\WikipediaInfoBoxParser\WikipediaInfoBoxParser;

$parser = (new WikipediaInfoBoxParser())
    ->setArticle('PHP');

$infobox = $parser->parse();

echo $infobox['designer'];
print_r($infobox['_categories']);
print_r($infobox['_links']);
echo $parser->getResolvedTitle();
echo $parser->getPageId();
```

The parser uses balanced template and link delimiters, so nested templates, multiline values, embedded pipes, and equals signs remain part of the correct field. Values equal to `0` are retained. All values are rendered together in a single MediaWiki parse request instead of one request per field.

### HTML values

[](#html-values)

Plain text is returned by default. To retain MediaWiki's rendered HTML:

```
use JordJD\WikipediaInfoBoxParser\Enums\Format;

$infobox = $parser
    ->setFormat(Format::HTML)
    ->parse();
```

### Selecting a template or Wikipedia edition

[](#selecting-a-template-or-wikipedia-edition)

`Infobox` matches normal variants such as `Infobox person`. Select a more specific prefix or a trusted alternate MediaWiki endpoint when needed:

```
$infobox = (new WikipediaInfoBoxParser())
    ->setEndpoint('https://de.wikipedia.org/w/api.php')
    ->setTemplateName('Infobox Programmiersprache')
    ->setArticle('PHP')
    ->parse();
```

The reserved `_categories` and `_links` arrays follow every MediaWiki continuation page and are deduplicated. Missing articles, malformed templates, API errors, bad JSON, and HTTP failures throw clear exceptions.

Caching and HTTP transport
--------------------------

[](#caching-and-http-transport)

Results are cached indefinitely in a system temporary directory by default. You can provide any PSR-6 pool, set a TTL, or disable caching:

```
$parser = (new WikipediaInfoBoxParser($yourPsr6Cache))
    ->setCacheTtl(3600);

$uncached = (new WikipediaInfoBoxParser())
    ->disableCache();
```

The optional second constructor argument is a callable receiving the endpoint, POST body, headers, and timeout. It is also shared with the batched wikitext renderer and must return the response body as a string.

The package supports PHP 7.1 through current PHP 8.x releases, Wikitext Parser 3.1+, and DO File Cache PSR-6 v3 or v4.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance83

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~288 days

Recently: every ~601 days

Total

10

Last Release

181d ago

Major Versions

v1.3.0 → v2.0.02019-07-13

v2.0.0 → v3.0.02019-07-14

v3.0.0 → v4.0.02019-07-19

v4.0.1 → v5.0.02026-02-14

v5.0.0 → v6.0.02026-02-14

### 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 (24 commits)")

---

Tags

parserphpphp-librarywikipediawikipedia-info-boxwikipedia-parser

### Embed Badge

![Health badge](/badges/divineomega-wikipedia-info-box-parser/health.svg)

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

###  Alternatives

[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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