API:Client code

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • 日本語 • русский
MediaWiki API

Quick overview:

v · d · e

Contents

[edit] API Access Libraries

Notes to library developers

  • Please use GZip compression when making API calls (Accept-Encoding: gzip).
Bots eat up a lot of bandwidth, which is not free.
Please include your username and wiki or email address.
  • You should attempt to minimize the number of API calls by asking for multiple items in one request. Use titles=PageA|PageB|PageC and get all the needed lists and properties at the same time. Only ask for what you actually need.
  • We are planning to migrate to JSON-only API, removing all other formats like XML, YAML, and PHP.
  • When querying, use the new continue parameter. (March 2013)

[edit] Bash

[edit] C++

[edit] Clojure

[edit] Common Lisp

  • cl-mediawiki is a Common Lisp wrapper for the mediawiki API. It is available as a direct download, or (more conveniently) via quicklisp.

[edit] Delphi/Object Pascal

[edit] Haskell

[edit] Java

[edit] Javascript

  • mediaWiki.Api - A ResourceLoader module that ships with MediaWiki core, abstracts many API logic calls into simple one liners.
  • jQuery.ajax - Not specifically made for the MediaWiki API, but most queries are very simple with one or two lines of using $.getJSON( .. ) or $.ajax( .. ).
  • JsMwApi A convenience wrapper around raw requests, with some helpers for editing and parsing.
  • mwapilib - A kind of crappy layer overtop of the requests. Make JS gadgets easier.
  • Luasóg - A framework of standard requests (e.g. log in, log out, read, edit, etc.) as well as a general wrapper method. Includes some helpful stuff like throttling. Project includes a rudimentary IDE for off-site development and execution.

[edit] .NET

  • AutoWikiBrowser's WikiFunctions library has classes for editing and getting lists of pages via the API. See ApiEdit
  • WikiAccess - a C#-library that makes some API functions accessible, has write API.
  • DotNetWikiBot Framework - written in C#, based on Microsoft® .NET Framework 2.0 (Tutorial)
  • MorebitsDotNet contains C# code for uploading files through the API.
  • LinqToWiki, strongly typed library for accessing most of MediaWiki API, with support for autocompletion

[edit] OCaml

[edit] Perl

[edit] PHP

There are many PHP frameworks for the api, see here for a full list and comparison of frameworks.

  • SxWiki - a lightweight, simple MediaWiki bot framework. (Unmaintained since 2008)

[edit] Python

[edit] Ruby

  • MediaWiki::Gateway - Ruby framework for the API. Actively maintained until August 2012, tested up to MediaWiki 1.19, compatible with Wikimedia wikis.
  • RWikiBot - a Ruby framework using the API. No releases since 2008.
  • rbmediawiki - Another Ruby framework that uses the API. No releases since 2009.

[edit] Tcl

[edit] Support Matrix

A support-matrix of many of the actively developed packages from this page for some of the more used API features can be found on the Wikia API Wiki.

[edit] See Also