This page provides an overview of the MediaWiki Action API, represented by the api.php endpoint. This page is intended for technical contributors and software developers who wish to understand and use the MediaWiki Action API.

Quick Start

Get the contents of an article on English Wikipedia in HTML:

Endpoint

All Wikimedia wikis have endpoints that follow this pattern: https://www.example.org/w/api.php

Examples of Wikimedia Wiki Endpoints
API Endpoint Wiki
https://www.mediawiki.org/w/api.php MediaWiki API
https://meta.wikimedia.org/w/api.php Meta-Wiki API
https://en.wikipedia.org/w/api.php English Wikipedia API
https://nl.wikipedia.org/w/api.php Dutch Wikipedia API
https://commons.wikimedia.org/w/api.php Wikimedia Commons API
https://test.wikipedia.org/w/api.php Test Wiki API

To see the endpoint URL on a particular wiki, see section "Entry point URLs" on the Special:Version page.

Introduction

The MediaWiki Action API is a web service that allows access to some wiki features like authentication, page operations, and search. It can provide meta information about the wiki and the logged-in user.

Uses for the MediaWiki Action API

  • Monitor a MediaWiki installation
  • Log in to a wiki, access data, and post changes by making HTTP requests to the web service

Getting started with MediaWiki Action API

Before you start using the MediaWiki Action API, you should review the following pages:

  • API etiquette and usage guidelines
  • Frequently asked questions
  • Input and output formats
  • Errors and warnings
  • Any policies that apply to the wiki you want to access, such as Wikimedia Foundation wikis' terms of use and trademark policy. These terms apply to you when you access or edit using the API, just as they do when you use your web browser.

API documentation


Special:ApiHelp/main

Other APIs

If you do not find what you are looking for in this API documentation, there are many other APIs related to Wikimedia projects. For the REST API included with MediaWiki 1.35 and later, see API:REST API.

API Availability URL base Example
MediaWiki Action API Included with MediaWiki

Enabled on Wikimedia projects

/api.php https://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Earth
MediaWiki REST API Included with MediaWiki 1.35+

Enabled on Wikimedia projects

/rest.php https://en.wikipedia.org/w/rest.php/v1/page/Earth
Wikimedia REST API Not included with MediaWiki

Available for Wikimedia projects only

/api/rest https://en.wikipedia.org/api/rest_v1/page/title/Earth
For commercial-scale APIs for Wikimedia projects, see Wikimedia Enterprise

Code stewardship

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.