API:Client code/ja

From MediaWiki.org
Jump to: navigation, search
このページは MediaWiki 操作 API の説明文書の一部です。

MediaWiki 操作 API

v · d · e



  • APIコールを作るときは、GZip圧縮を使って下さい。
  • 意味のあるユーザーエージェントヘッダを使ってください。User-Agent: 利用者名/メールアドレス/フレームワーク名/...のように、利用者名とメールアドレスを入れてください。
  • APIアクセスはできるだけひとつにまとめて、回数を減らすように心がけてください。 titles=PageA|PageB|PageC を使うと、必要なリストと属性が一度に取得できます。必要な項目だけを要求してください。
  • XML、YAML、PHPを廃止して、JSONのみのAPIに移行する計画があります。
  • クエリを置くときは、新しい continue パラメータを使ってください(2013年3月)。




Common Lisp[edit]

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

Delphi/Object Pascal[edit]


  • go-mediawiki Go wrapper for the MediaWiki API
  • go-mwclient another Go wrapper for the MediaWiki API (supports maxlag)



  • Bliki Engine - Java Wikipedia API - 完全ではありませんが、基本的な機能性を持ちます。wikicodeをHTML、DocBookもしくはPDFに変換でできます。
  • JavaWikiBotFramework - ほとんどすべてのAPI機能をアクセスできるようにするJavaライブラリ。
  • Wiki.java — a simple one-class API implementation
  • WPCleaner — a Java editing tool that includes a package for MediaWiki API.


  • https://github.com/macbre/nodemw - Node.js client.
  • mediawiki.api.js - A module that ships with MediaWiki core, abstracts many API calls into simple one liners (uses jQuery.ajax internally).
  • 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.


  • AutoWikiBrowser's WikiFunctions library has classes for editing and getting lists of pages via the API. See ApiEdit
  • WikiAccess - いくつかのAPI機能をアクセス可能にし、書き込みAPIを持つC#ライブラリ。
  • 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




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)
  • Apibot - a modular, somewhat ambitious bot with overlayed UNIX-like framework
  • wikibase-api-php - Specifically for querying Wikidata
  • wikidrain - A wrapper for the WikiMedia API centralized around easily and simply querying Wikipedia articles. (Still actively being developed)


  • Pywikipediabot - Pythonスクリプトのコレクション。Seems up to date (Nov 2013) (IRC)
  • mwclient - 大抵のAPI機能にアクセスできるようになるPythonライブラリ。(PyPI)
  • wikitools - Provides several layers of abstraction around the API. Should be up to date (PyPI)
  • Wikipedia -  A Python library that makes it easy to access and parse data from Wikipedia. (PyPI)
  • simplemediawiki - A simple, no-abstraction interface to the API. Handles cookies and other extremely basic things. Python 2.6+ and 3.3+ compatible. (PyPI)
  • supersimplemediawiki - Very similar to simplemediawiki.
  • python-mwapi - A simple wrapper around the Mediawiki API, meant to closely mirror its interface. Last update: Dec 2012 (PyPI)


  • wikipedia-client - Ruby framework using the API.
  • MediaWiki::Gateway - Ruby framework for the API. Maintained, tested up to MediaWiki 1.22, compatible with Wikimedia wikis.
  • RWikiBot - MediaWiki APIを使うRubyフレームワーク。2008年以降更新なし。
  • rbmediawiki - Another Ruby framework that uses the API. No releases since 2009.


Support Matrix[edit]

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.

See Also[edit]