API/th: Difference between revisions
Created page with "Yuagtuagvimkoj" Tag: Reverted |
Updating to match new version of source page |
||
| (13 intermediate revisions by 5 users not shown) | |||
| Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Yuagtuagvimkoj |
|||
MediaWiki has several [[w:API|application programming interfaces]] ('''APIs'''). |
|||
</div> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
<div lang="en" dir="ltr" class="mw-content-ltr"> |
||
MediaWiki offers the following web APIs: |
|||
The three most important APIs of MediaWiki are: |
|||
</div> |
</div> |
||
* <span lang="en" dir="ltr" class="mw-content-ltr">the [[Special:MyLanguage/API:Action API|MediaWiki Action API]] (<code>api.php</code>)</span> |
|||
* Yuagtuagvimkoj |
|||
* <span lang="en" dir="ltr" class="mw-content-ltr">the [[Special:MyLanguage/API:REST API|MediaWiki REST API]]</span> (<code>rest.php</code>) |
|||
* Yuagtuagvimkoj |
|||
<span lang="en" dir="ltr" class="mw-content-ltr">The Action API provides a much broader set of functionality, while the REST API (which is newer) has better-structured URLs and runs faster.</span> |
|||
<span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki also includes the following software APIs:</span> |
|||
* <span lang="en" dir="ltr" class="mw-content-ltr">the [[wmdoc:mediawiki-core/master/php/|MediaWiki PHP API]], which can be used to develop {{ll|Manual:Extensions|extensions}} for MediaWiki in {{ll|PHP}}</span> |
|||
* <span lang="en" dir="ltr" class="mw-content-ltr">the [[wmdoc:mediawiki-core/master/js/|MediaWiki JavaScript API]] (''mw''), which can be used to develop {{ll|user scripts|user scripts and gadgets}} to extend the MediaWiki user interface</span> |
* <span lang="en" dir="ltr" class="mw-content-ltr">the [[wmdoc:mediawiki-core/master/js/|MediaWiki JavaScript API]] (''mw''), which can be used to develop {{ll|user scripts|user scripts and gadgets}} to extend the MediaWiki user interface</span> |
||
| Line 21: | Line 28: | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
<div lang="en" dir="ltr" class="mw-content-ltr"> |
||
== |
== APIs for Wikimedia wikis == |
||
</div> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
For information about APIs available for Wikimedia wikis, see {{ll|Wikimedia APIs}}. |
|||
</div> |
</div> |
||
{{API comparison}} |
|||
{{anchor|phabricator}} |
{{anchor|phabricator}} |
||
Latest revision as of 15:24, 5 April 2026
MediaWiki has several application programming interfaces (APIs).
MediaWiki offers the following web APIs:
- the MediaWiki Action API (
api.php) - the MediaWiki REST API (
rest.php)
The Action API provides a much broader set of functionality, while the REST API (which is newer) has better-structured URLs and runs faster.
MediaWiki also includes the following software APIs:
- 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 and gadgets 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 can also be disabled.
Within the context of the MediaWiki website the Action API can be accessed from JavaScript via the mw.Api JavaScript API. (mw.ForeignApi for allowed cross-site requests, e.g. between WMF wikis.) For libraries to access the MediaWiki Action API from your favorite programming language, see API:Client code.
APIs for Wikimedia wikis
For information about APIs available for Wikimedia wikis, see Wikimedia APIs.
ดูเพิ่ม
Suggestions and ideas for the MediaWiki APIs are tracked on ฟาบริเคเตอร์:
- 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
Footnotes
- ↑ For extending the Action API, see API:Extensions. For information about JavaScript modules, see ResourceLoader.