미디어위키 API 도움말

이 페이지는 자동으로 생성된 미디어위키 API 도움말 문서입니다.

설명 문서 및 예시: https://www.mediawiki.org/wiki/API

메인 모듈

상태: 이 페이지에 표시된 모든 기능은 정상 작동할 것이지만, API는 여전히 활발하게 개발되고 있으며, 언제든지 바뀔 수 있습니다. 업데이트 정보를 받아보려면 the mediawiki-api-announce 메일링 리스트를 구독하십시오.

잘못된 요청: API에 잘못된 요청이 전송되면 HTTP 헤더에서 "MediaWiki-API-Error" 키를 보내고, 헤더 값과 오류 코드가 같게 설정됩니다. 자세한 정보에 대해서는 API:오류 및 경고를 참조하십시오.

변수:
action

수행할 동작

하나의 값: block, checktoken, clearhasmsg, compare, createaccount, delete, edit, emailuser, expandtemplates, feedcontributions, feedrecentchanges, feedwatchlist, filerevert, help, imagerotate, import, login, logout, managetags, move, opensearch, options, paraminfo, parse, patrol, protect, purge, query, revisiondelete, rollback, rsd, setnotificationtimestamp, stashedit, tag, tokens, unblock, undelete, upload, userrights, watch
기본값: help
format

출력값의 형식.

하나의 값: dbg, dbgfm, json, jsonfm, none, php, phpfm, rawfm, txt, txtfm, xml, xmlfm, yaml, yamlfm
기본값: jsonfm
maxlag

Maximum lag can be used when MediaWiki is installed on a database replicated cluster. To save actions causing any more site replication lag, this parameter can make the client wait until the replication lag is less than the specified value. In case of excessive lag, error code maxlag is returned with a message like Waiting for $host: $lag seconds lagged.
See Manual: Maxlag parameter for more information.

유형: 정수
smaxage

Set the s-maxage HTTP cache control header to this many seconds. Errors are never cached.

유형: 정수
기본값: 0
maxage

Set the max-age HTTP cache control header to this many seconds. Errors are never cached.

유형: 정수
기본값: 0
assert

Verify the user is logged in if set to user, or has the bot user right if bot.

하나의 값: user, bot
requestid

Any value given here will be included in the response. May be used to distinguish requests.

servedby

Include the hostname that served the request in the results.

유형: 부울 (자세한 정보)
curtimestamp

Include the current timestamp in the result.

유형: 부울 (자세한 정보)
origin

When accessing the API using a cross-domain AJAX request (CORS), set this to the originating domain. This must be included in any pre-flight request, and therefore must be part of the request URI (not the POST body). This must match one of the origins in the Origin header exactly, so it has to be set to something like https://en.wikipedia.org or https://meta.wikimedia.org. If this parameter does not match the Origin header, a 403 response will be returned. If this parameter matches the Origin header and the origin is whitelisted, an Access-Control-Allow-Origin header will be set.

uselang

Language to use for message translations. A list of codes may be fetched from action=query&meta=siteinfo with siprop=languages, or specify user to use the current user's language preference, or specify content to use this wiki's content language.

기본값: user
예시:
Help for the main module.
api.php?action=help
All help in one page.
api.php?action=help&recursivesubmodules=1
권한:
writeapi
쓰기 API 사용
다음 그룹에 부여됨: all, user, bot
apihighlimits
Use higher limits in API queries (slow queries: 500; fast queries: 5000). The limits for slow queries also apply to multivalue parameters.
다음 그룹에 부여됨: bot, sysop

데이터 유형

API 요청 내 몇몇 매개변수형에 대해 더 자세히 설명해보겠습니다:

boolean
Boolean 매개변수들은 HTML 체크박스처럼 동작합니다: 만약 매개변수가 지저오딨다면, 값에 상관없이 참의 값으로 여겨집니다. 거짓값은 매개변수 전체를 생략하여 표현해보세요.
timestamp
타임스팸프들은 여러 형식으로 표현될 수 있으나 ISO 8601 날짜와 시간이 추천됩니다. 모든 시간은 UTC이어야 하며, 포함된 시간대는 모두 무시됩니다.
  • ISO 8601 날짜와 시간, 2001-01-15T14:56:00Z (구두점과 Z는 선택입니다.)
  • ISO 8601 날짜와 시간과 (무시되는) 소수 초, 2001-01-15T14:56:00.00001Z (대시, 콜론과 Z 는 선택입니다.)
  • 미디어위키 형식, 20010115145600
  • 일반적인 수 형식 2001-01-15 14:56:00 (GMT, +##, 또는 -##와 같은 선택적 시간대는 무시됩니다)
  • RFC 2822 형식 (시간대는 생략될 수 있음), Mon, 15 Jan 2001 14:56:00
  • RFC 850 형식 (시간대는 생략될 수 있음), Monday, 15-Jan-2001 14:56:00
  • C ctime 형식, Mon Jan 15 14:56:00 2001
  • 1부터 13자리까지의 숫자로 표현된 1970-01-01T00:00:00Z 부터 흐른 시간(초)

Credits

API 개발자:

  • Roan Kattouw (선임 개발자, 2007년 9월–2009년)
  • Victor Vasiliev
  • Bryan Tong Minh
  • Sam Reed
  • Yuri Astrakhan (초기 개발자, 선임 개발자 2006년 9월~2007년 9월)
  • Brad Jorsch (선임 개발자 2013년–현재)

당신의 의견이나 제안, 질문은 mediawiki-api@lists.wikimedia.org 로 보내주시거나, https://phabricator.wikimedia.org/ 에 버그 신고를 해 주시기 바랍니다..