미디어위키 API 도움말

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

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

메인 모듈

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

잘못된 요청: API에 잘못된 요청이 전송되면 "MediaWiki-API-Error" 키가 포함된 HTTP 헤더가 전송되며 반환되는 헤더와 오류 코드의 값은 동일한 값으로 설정됩니다. 자세한 정보에 대해서는 API:오류와 경고를 참조하십시오.

테스트하기: API 요청 테스트를 용이하게 하려면, Special:ApiSandbox를 보십시오.

변수:
action

수행할 동작

다음 값 중 하나: block, categorytree, changeauthenticationdata, checktoken, clearhasmsg, clientlogin, compare, createaccount, cspreport, delete, edit, emailuser, expandtemplates, feedcontributions, feedrecentchanges, feedwatchlist, filerevert, help, imagerotate, import, linkaccount, login, logout, managetags, mergehistory, move, opensearch, options, paraminfo, parse, patrol, protect, purge, query, removeauthenticationdata, resetpassword, revisiondelete, rollback, rsd, scribunto-console, setnotificationtimestamp, stashedit, tag, templatedata, tokens, unblock, undelete, unlinkaccount, upload, userrights, watch
기본값: help
format

출력값의 형식.

다음 값 중 하나: json, jsonfm, none, php, phpfm, rawfm, xml, xmlfm
기본값: jsonfm
maxlag

최대 랙은 미디어위키가 데이터베이스 복제된 클러스터에 설치되었을 때 사용될 수 있습니다. 특정한 행동이 사이트 복제 랙을 유발할 때, 이 변수는 클라이언트가 복제 랙이 설정된 숫자 아래로 내려갈 때까지 기다리도록 지시합니다. 과도한 랙의 경우, maxlag 오류 코드와 Waiting for $host: $lag seconds lagged 메시지가 제공됩니다.
매뉴얼: Maxlag 변수 에서 더 많은 정보를 얻을 수 있습니다.

유형: 정수
smaxage

s-maxage HTTP 캐시 컨트롤 헤더를 설정합니다. 오류는 캐시되지 않습니다.

유형: 정수
기본값: 0
maxage

max-age HTTP 캐시 컨트롤 헤더를 설정합니다. 오류는 캐시되지 않습니다.

유형: 정수
기본값: 0
assert

user 플래그가 설정되어 있다면 로그인 여부를 체크하며, bot 플래그가 설정되어 있다면 봇 사용자 권한이 설정되어 있는지 확인합니다.

다음 값 중 하나: user, bot
assertuser

Verify the current user is the named user.

Type: user name
requestid

주어진 요청 값은 응답에 포함됩니다. 요청을 구분하기 위해 사용될 수 있습니다.

servedby

결과에 요청을 처리한 호스트네임을 포함합니다.

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

결과의 타임스탬프를 포함합니다.

유형: 부울 (자세한 정보)
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).

For authenticated requests, 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, the Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers will be set.

For non-authenticated requests, specify the value *. This will cause the Access-Control-Allow-Origin header to be set, but Access-Control-Allow-Credentials will be false and all user-specific data will be restricted.

uselang

Language to use for message translations. action=query&meta=siteinfo with siprop=languages returns a list of language codes, 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 [연습장에서 열기]
모든 도움말을 한 페이지로 모읍니다.
api.php?action=help&recursivesubmodules=1 [연습장에서 열기]
권한:
writeapi
쓰기 API 사용
다음 그룹에 부여됨: 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부터 흐른 시간(초) (0을 제외)
  • 문자열 now

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/ 에 버그 보고를 해 주시기 바랍니다.