MediaWiki has severalapplication programming interfaces (APIs).
The three most important APIs of MediaWiki are:
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 intoMediaWiki Core are available in most MediaWiki wikis, built-in Action API modulescan also be disabled.
Within the context of the MediaWiki website the Action API can be accessed from JavaScript via themw.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, seeAPI:Client code.
API | Availability | URL base | Example |
---|---|---|---|
![]() | Included with MediaWiki Enabled onWikimedia projects | /api.php | https://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Earth |
![]() | Included with MediaWiki 1.35+ Enabled onWikimedia projects | /rest.php | https://en.wikipedia.org/w/rest.php/v1/page/Earth |
![]() | Not included with MediaWiki Available forWikimedia projects only | /api/rest | https://en.wikipedia.org/api/rest_v1/page/title/Earth |
![]() |
Suggestions and ideas for the MediaWiki APIs are tracked onPhabricator: