PHPackages                             addwiki/mediawiki-api - 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. [API Development](/categories/api)
4. /
5. addwiki/mediawiki-api

ActiveLibrary[API Development](/categories/api)

addwiki/mediawiki-api
=====================

A MediaWiki API library

3.1.0(1y ago)43106.3k↑80%167GPL-2.0-or-laterPHPPHP &gt;=8.1

Since Feb 23Pushed 1y ago8 watchersCompare

[ Source](https://github.com/addwiki/mediawiki-api)[ Packagist](https://packagist.org/packages/addwiki/mediawiki-api)[ RSS](/packages/addwiki-mediawiki-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (20)Used By (7)

mediawiki-api
=============

[](#mediawiki-api)

[![GitHub issue custom search in repo](https://camo.githubusercontent.com/cbc8f31b7465378c42de1417f232653c8f4cd69f8b4616405f82a8bac979ad31/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7365617263682f61646477696b692f61646477696b693f6c6162656c3d6973737565732671756572793d6973253341697373756525323069732533416f70656e2532302535426d6564696177696b692d617069253544)](https://github.com/addwiki/addwiki/issues?q=is%3Aissue+is%3Aopen+%5Bmediawiki-api%5D+)[![Latest Stable Version](https://camo.githubusercontent.com/f4a031ac2555f86617e30d3c0606e11d73f4d9efc376971d8b46291a80cfea3e/68747470733a2f2f706f7365722e707567782e6f72672f61646477696b692f6d6564696177696b692d6170692f76657273696f6e2e706e67)](https://packagist.org/packages/addwiki/mediawiki-api)[![Download count](https://camo.githubusercontent.com/74427e6a0ce7cbec50cd88f0b6e1b27b0cf0fec74cf6f76c107d032133438903/68747470733a2f2f706f7365722e707567782e6f72672f61646477696b692f6d6564696177696b692d6170692f642f746f74616c2e706e67)](https://packagist.org/packages/addwiki/mediawiki-api)

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

[](#installation)

Use composer to install the library and all its dependencies:

```
composer require "addwiki/mediawiki-api:~3.0"

```

Example Usage
-------------

[](#example-usage)

```
// Load all the stuff
require_once( __DIR__ . '/vendor/autoload.php' );

// Create an authenticated API and services
$auth = new \Addwiki\Mediawiki\Api\Client\Auth\UserAndPassword( 'username', 'password' )
$api = new \Addwiki\Mediawiki\Api\Client\Action\ActionApi( 'http://localhost/w/api.php', $auth );
$services = new \Addwiki\Mediawiki\Api\MediawikiFactory( $api );

// Get a page
$page = $services->newPageGetter()->getFromTitle( 'Foo' );

// Edit a page
$content = new \Addwiki\Mediawiki\DataModel\Content( 'New Text' );
$revision = new \Addwiki\Mediawiki\DataModel\Revision( $content, $page->getPageIdentifier() );
$services->newRevisionSaver()->save( $revision );

// Move a page
$services->newPageMover()->move(
	$services->newPageGetter()->getFromTitle( 'FooBar' ),
	new Title( 'FooBar' )
);

// Delete a page
$services->newPageDeleter()->delete(
	$services->newPageGetter()->getFromTitle( 'DeleteMe!' ),
	array( 'reason' => 'Reason for Deletion' )
);

// Create a new page
$newContent = new \Addwiki\Mediawiki\DataModel\Content( 'Hello World' );
$title = new \Addwiki\Mediawiki\DataModel\Title( 'New Page' );
$identifier = new \Addwiki\Mediawiki\DataModel\PageIdentifier( $title );
$revision = new \Addwiki\Mediawiki\DataModel\Revision( $newContent, $identifier );
$services->newRevisionSaver()->save( $revision );

// List all pages in a category
$pages = $services->newPageListGetter()->getPageListFromCategoryName( 'Category:Cat name' );
```

Running the integration tests
-----------------------------

[](#running-the-integration-tests)

To run the integration tests, you need to have a running MediaWiki instance. The tests will create pages and categories without using a user account so it's best if you use a test instance. Furthermore you need to turn off rate limiting by adding the line

$wgGroupPermissions\['\*'\]\['noratelimit'\] = true;

to the `LocalSettings.php` of your MediaWiki.

By default, the tests will use the URL `http://localhost/w/api.php` as the API endpoint. If you have a different URL (e.g. `http://localhost:8080/w/api.php`), you need to configure the URL as an environment variable before running the tests. Example:

```
export MEDIAWIKI_API_URL='http://localhost:8080/w/api.php'

```

**Warning:** Running the integration tests can take a long time to complete.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.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 ~259 days

Recently: every ~337 days

Total

16

Last Release

580d ago

Major Versions

0.7.3 → 2.6.02021-02-02

2.8.0 → 3.0.02021-10-23

PHP version history (3 changes)2.8.0PHP &gt;=7.3

3.0.0PHP &gt;=7.4

3.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccc2c40c150701b6b72f598f342b6a7aa57d7ab06a08c5f085f6add75094b82b?d=identicon)[addshore](/maintainers/addshore)

---

Top Contributors

[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (153 commits)")[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (31 commits)")[![brendajerop](https://avatars.githubusercontent.com/u/20903830?v=4)](https://github.com/brendajerop "brendajerop (11 commits)")[![karatakis](https://avatars.githubusercontent.com/u/7329022?v=4)](https://github.com/karatakis "karatakis (10 commits)")[![gbirke](https://avatars.githubusercontent.com/u/223326?v=4)](https://github.com/gbirke "gbirke (5 commits)")[![DFelten](https://avatars.githubusercontent.com/u/1169185?v=4)](https://github.com/DFelten "DFelten (3 commits)")[![KaiNissen](https://avatars.githubusercontent.com/u/5435996?v=4)](https://github.com/KaiNissen "KaiNissen (2 commits)")[![Tpt](https://avatars.githubusercontent.com/u/458123?v=4)](https://github.com/Tpt "Tpt (1 commits)")[![Benestar](https://avatars.githubusercontent.com/u/2998254?v=4)](https://github.com/Benestar "Benestar (1 commits)")[![Dispositif](https://avatars.githubusercontent.com/u/3756769?v=4)](https://github.com/Dispositif "Dispositif (1 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (1 commits)")[![JohnFLewis](https://avatars.githubusercontent.com/u/2326864?v=4)](https://github.com/JohnFLewis "JohnFLewis (1 commits)")[![ricordisamoa](https://avatars.githubusercontent.com/u/4588496?v=4)](https://github.com/ricordisamoa "ricordisamoa (1 commits)")[![Southparkfan](https://avatars.githubusercontent.com/u/5605877?v=4)](https://github.com/Southparkfan "Southparkfan (1 commits)")

---

Tags

apimediawiki

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/addwiki-mediawiki-api/health.svg)

```
[![Health](https://phpackages.com/badges/addwiki-mediawiki-api/health.svg)](https://phpackages.com/packages/addwiki-mediawiki-api)
```

###  Alternatives

[addwiki/mediawiki-api-base

Simple MediaWiki API library

37149.7k12](/packages/addwiki-mediawiki-api-base)[addwiki/wikibase-api

Wikibase API library

254.7k3](/packages/addwiki-wikibase-api)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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