API
MediaWiki possède plusieurs interfaces de programmation applicatives (API — application programming interface).
Les APIs de MediaWiki les plus importantes sont :
- the MediaWiki Action API (api.php), which is a web API that lets you read and write content of a Wiki MédiaWiki
- the MediaWiki PHP API, which can be used to develop extensions for MediaWiki in PHP
- the MediaWiki JavaScript API (mw), which can be used to develop user scripts to extend the MediaWiki user interface
Note that the MediaWiki Action API and the MediaWiki JavaScript API are both modular: both can be extended by extensions, so the available API modules can differ from wiki to wiki.[1] While the API modules built into MediaWiki Core are available in most MediaWiki wikis, built-in Action API modules API:Limiter l'utilisation de l'API.
Within the context of the MediaWiki website the Action API can be accessed from JavaScript via the mw.API JavaScript API. For libraries to access the MediaWiki Action API from your favorite programming language, see API:code client.
Autres APIs web
| API | Disponibilité | Base de l'URL | Exemple |
|---|---|---|---|
| Inclus dans MediaWiki
Activé sur les projets Wikimedia |
/api.php | https://fr.wikipedia.org/w/api.php?action=query&prop=info&titles=Terre | |
| Inclus dans MediaWiki 1.35+
Activé sur les projets Wikimedia |
/rest.php | https://fr.wikipedia.org/w/rest.php/v1/page/Terre | |
| Non inclus dans MediaWiki
Disponible uniquement dans les projets Wikimedia |
/api/rest | https://fr.wikipedia.org/api/rest_v1/page/title/Terre | |
Voir aussi
Suggestions and ideas for the MediaWiki APIs are tracked on Phabricator:
- Phabricator tasks for the MediaWiki-Action-API
- Phabricator tasks for the MediaWiki-Core-Hooks that are part of the PHP API
- Phabricator tasks related to JavaScript in MediaWiki core or extensions
- Phabricator tasks for the MediaWiki-REST-API
Notes
- ↑ Pour étendre l'API Action, voir API:Extensions. For information about JavaScript modules, see ResourceLoader.