GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Get MediaWiki
  • Get extensions
  • Tech blog
  • Contribute
  • User help
  • FAQ
  • Technical manual
  • Support desk
  • Communication
  • Developer portal
  • Code statistics
  • Community portal
  • Recent changes

This view

  • Original page
  • New address

GeezerVison is showing www.mediawiki.org — API:REST API/Get started - MediaWiki

< API:REST API

This page helps you get started using the MediaWiki REST API to perform common types of operations.

Before you begin

Your use of the MediaWiki REST API must follow the access and usage policies.

Sample call

# Search English Wikipedia for an article about Earth $ curl "https://en.wikipedia.org/w/rest.php/v1/search/page?q=earth&limit=1"

Try it out

Data formats

REST API endpoints return data in JSON or HTML format. See the API reference for the content type supported by each endpoint.

URL structure

API endpoints share a consistent URL structure that includes the wiki's base URL, the wiki's script path, and the API version:

# URL structure>
[project url]/[script path]/rest.php/v[version number]/

# Example URL: Get the history of the Main Page of English Wikipedia
https://en.wikipedia.org/w/rest.php/v1/page/Main_Page/history

Use conditional requests to optimize API calls

See Wikimedia APIs/Conditional requests.

Make cross-origin requests

For instructions on how to use cross-origin resource sharing (CORS) requests in your JavaScript code to communicate between wikis on different domains, see Special:MyLanguage/Manual:CORS.

Next steps

  • Set up authentication for your app
  • See more query examples in the API reference
Retrieved from "https://www.mediawiki.org/w/index.php?title=API:REST_API/Get_started&oldid=8650188"
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.