API:Etiquette/ja

注: このページでは作業が進行中です

クイック スタート ガイドもお読みください. このページで回答していない質問についても回答しており、その他の有用なページヘのリンクもあります.

ヘルプ

 * 1) この「よくある質問」をお読みください
 * 2) Try to find the answer to your question in the API documentation here or on the self-documenting API home page.
 * 3) If you can't find the answer to your question on the web, you can ask your question on the mediawiki-api mailing list.

リクエストの上限
There is no hard and fast limit on read requests, but we ask that you be considerate and try not to take a site down. Most sysadmins reserve the right to unceremoniously block you if you do endanger the stability of their site.

If you make your requests in series rather than in parallel (i.e. wait for the one request to finish before sending a new request, such that you're never making more than one request at the same time), then you should definitely be fine. Also try to combine things into one request where you can (e.g. use multiple titles in a  parameter instead of making a new request for each title. Or use "generator" if possible instead of making a request for each result from another request).

版の構文解析
While it is possible to query for results from a specific revision number this is an expensive operation for the servers. To retrieve a specific revision use the 'oldid' parameter, example:
 * [//en.wikipedia.org/w/api.php?action=parse&format=xml&prop=images&oldid=254862759 en.wikipedia.org/w/api.php?action=parse&format=xml&prop=images&oldid=254862759]
 * [//en.wikipedia.org/w/api.php?action=parse&format=xml&prop=images&oldid=462841413 en.wikipedia.org/w/api.php?action=parse&format=xml&prop=images&oldid=462841413]

maxlag パラメーターの使用
If your task is not interactive (i.e. A user is not waiting for the result) you should use the maxlag parameter. This will prevent your task from running when the load on the servers is high. Higher values mean more aggressive behaviour, lower values are nicer.

Manual:Maxlag_parameter を参照してください.

User-Agent ヘッダー
Use a descriptive  header that includes your application's name and potentially your email address if appropriate. 人気があるウェブ ブラウザーからコピーしないでください (あなたの API クライアントが、そのウェブ ブラウザーで Ajax を使用して動作する JavaScript アプリケーションである場合を除きます. この場合は User-Agent を変更できないためです). これにより、問題が発生した場合に発生源を特定するのが容易になります. 詳細は API:Quick_start_guide と User-Agent_policy を参照してください.

Thinking about performance generally
If you are trying to figure out why you are getting results more slowly than you would like, try Performance guidelines to help you think about performance generally. If you are finding that reading via the API rather than directly reading from databases is impeding your client's performance, consider whether to put it into Wikimedia's Tool Labs.