MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/API

Main module

Status: De MediaWiki API is een stabiele interface die actief ondersteund en verbeterd wordt. Hoewel we het proberen te voorkomen, is het mogelijk dat er soms wijzigingen worden aangebracht die bepaalde API-verzoek kunnen verhinderen; abonneer u op de e-maillijst mediawiki-api-announce voor meldingen over wijzigingen.

Foutieve verzoeken: als de API foutieve verzoeken ontvangt, wordt er geantwoord met een HTTP-header met de sleutel "MediaWiki-API-Error" en daarna worden de waarde van de header en de foutcode op dezelfde waarde ingesteld. Zie API: Foutmeldingen en waarschuwingen voor meer informatie.

Parameters:
action

Welke handeling uit te voeren.

ask
API module to query Semantic MediaWiki using the ask language.
askargs
API module to query Semantic MediaWiki using the ask language as list of conditions, printouts and parameters.
block
Gebruiker blokkeren.
changeauthenticationdata
Change authentication data for the current user.
checktoken
De geldigheid van een token van action=query&meta=tokens controleren.
clearhasmsg
Wist de hasmsg-vlag voor de huidige gebruiker.
clientlogin
Bij de wiki aanmelden met behulp van de interactieve flow.
compare
Het verschil tussen twee pagina's ophalen.
createaccount
Een nieuw gebruikersaccount aanmaken.
cspreport
Used by browsers to report violations of the Content Security Policy. This module should never be used, except when used automatically by a CSP compliant web browser.
delete
Een pagina verwijderen.
edit
Pagina's aanmaken en bewerken.
emailuser
Gebruiker e-mailen.
expandtemplates
Expands all templates within wikitext.
ext.srf.slideshow.show
⧼apihelp-ext.srf.slideshow.show-summary⧽
feedcontributions
Retourneert een feed van gebruikersbijdragen.
feedrecentchanges
Returns a recent changes feed.
feedwatchlist
Returns a watchlist feed.
filerevert
Een oude versie van een bestand terugplaatsen.
help
Toon hulp voor de opgegeven modules.
imagerotate
Een of meerdere afbeeldingen draaien.
import
Importeer een pagina van een andere wiki, of van een XML-bestand.
linkaccount
Link an account from a third-party provider to the current user.
login
Log in and get authentication cookies.
logout
Afmelden en sessiegegevens wissen.
managetags
Perform management tasks relating to change tags.
mergehistory
Geschiedenissen van pagina's samenvoegen.
move
Pagina hernoemen.
opensearch
In de wiki zoeken met behulp het OpenSearchprotocol.
options
Voorkeuren van de huidige gebruiker wijzigen.
paraminfo
Verkrijg informatie over API-modules.
parse
Parses content and returns parser output.
patrol
Een pagina of revisie als gecontroleerd markeren.
pfautocomplete
Automatisch aanvullen gebruikt door de uitbreiding Paginaformulieren.
pfautoedit
Maak of bewerk een pagina met behulp van een formulier dat is gedefinieerd door de uitbreiding Paginaformulieren.
protect
Change the protection level of a page.
purge
Purge the cache for the given titles.
query
Fetch data from and about MediaWiki.
removeauthenticationdata
Remove authentication data for the current user.
resetpassword
Send a password reset email to a user.
revisiondelete
Delete and undelete revisions.
rollback
Undo the last edit to the page.
rsd
Export an RSD (Really Simple Discovery) schema.
setnotificationtimestamp
Update the notification timestamp for watched pages.
setpagelanguage
Change the language of a page.
smwbrowse
API module to support browse activties for different entity types in Semantic MediaWiki.
smwinfo
API module to retrieve information about Semantic MediaWiki statistics and other meta information.
smwtask
API module to execute Semantic MediaWiki related tasks.
stashedit
Prepare an edit in shared cache.
tag
Add or remove change tags from individual revisions or log entries.
unblock
Unblock a user.
undelete
Restore revisions of a deleted page.
unlinkaccount
Remove a linked third-party account from the current user.
upload
Upload a file, or get the status of pending uploads.
userrights
Change a user's group membership.
validatepassword
Validate a password against the wiki's password policies.
watch
Add or remove pages from the current user's watchlist.
browsebyproperty
Verouderd. API module to retrieve information about a property or list of properties.
browsebysubject
Verouderd. API module to retrieve information about a subject.
tokens
Verouderd. Get tokens for data-modifying actions.
One of the following values: ask, askargs, block, changeauthenticationdata, checktoken, clearhasmsg, clientlogin, compare, createaccount, cspreport, delete, edit, emailuser, expandtemplates, ext.srf.slideshow.show, feedcontributions, feedrecentchanges, feedwatchlist, filerevert, help, imagerotate, import, linkaccount, login, logout, managetags, mergehistory, move, opensearch, options, paraminfo, parse, patrol, pfautocomplete, pfautoedit, protect, purge, query, removeauthenticationdata, resetpassword, revisiondelete, rollback, rsd, setnotificationtimestamp, setpagelanguage, smwbrowse, smwinfo, smwtask, stashedit, tag, unblock, undelete, unlinkaccount, upload, userrights, validatepassword, watch, browsebyproperty, browsebysubject, tokens
Standaard: help
format

De opmaak van de uitvoer.

json
Output data in JSON format.
jsonfm
Output data in JSON format (pretty-print in HTML).
none
Output nothing.
php
Output data in serialized PHP format.
phpfm
Output data in serialized PHP format (pretty-print in HTML).
rawfm
Gegevens, inclusief debugelementen, in JSON-formaat (nette opmaak in HTML) uitvoeren.
xml
Output data in XML format.
xmlfm
Output data in XML format (pretty-print in HTML).
One of the following values: json, jsonfm, none, php, phpfm, rawfm, xml, xmlfm
Standaard: jsonfm
maxlag

De maximale vertraging kan gebruikt worden als MediaWiki is geïnstalleerd op een databasecluster die gebruik maakt van replicatie. Om te voorkomen dat handelingen nog meer databasereplicatievertraging veroorzaken, kan deze parameter ervoor zorgen dat de client wacht totdat de replicatievertraging lager is dan de aangegeven waarde. In geval van buitensporige vertraging wordt de foutcode maxlag teruggegeven met een bericht als Waiting for $host: $lag seconds lagged.
Zie Handleiding:Maxlag parameter voor meer informatie.

Type: integer
smaxage

Stelt de s-maxage HTTP cache controle header in op het aangegeven aantal seconden. Foutmeldingen komen nooit in de cache.

Type: integer
Standaard: 0
maxage

Stelt de max-age HTTP cache controle header in op het aangegeven aantal seconden. Foutmeldingen komen nooit in de cache.

Type: integer
Standaard: 0
assert

Controleer of de gebruiker is aangemeld indien assert=user, of het botgebruikersrecht heeft indien assert=bot.

One of the following values: user, bot
assertuser

Controleer of de huidige gebruiker de genoemde gebruiker is.

Type: user name
requestid

Elke waarde die hier gegeven wordt, wordt aan het antwoord toegevoegd. Dit kan gebruikt worden om verzoeken te onderscheiden.

servedby

De hostnaam van de server die de aanvraag heeft afgehandeld aan de resultaten toevoegen.

Type: boolean (details)
curtimestamp

Huidige tijd aan de resultaten toevoegen.

Type: boolean (details)
responselanginfo

De voor uselang en errorlang gebruikte talen aan de resultaten toevoegen.

Type: boolean (details)
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.

Standaard: user
errorformat

Format to use for warning and error text output.

plaintext
Wikitext with HTML tags removed and entities replaced.
wikitext
Unparsed wikitext.
html
HTML.
raw
Message key and parameters.
none
No text output, only the error codes.
bc
Format used prior to MediaWiki 1.29. errorlang and errorsuselocal are ignored.
One of the following values: plaintext, wikitext, html, raw, none, bc
Standaard: bc
errorlang

De voor waarschuwingen en fouten te gebruiken taal. action=query&meta=siteinfo met siprop=languages geeft een lijst van taalcodes, of stel content in om de taal van de inhoud van deze wiki te gebruiken, of stel uselang in om dezelfde waarde als de parameter uselang te gebruiken.

Standaard: uselang
errorsuselocal

Indien ingesteld maken foutmeldingen gebruik van lokaal-aangepaste berichten in de MediaWiki-naamruimte.

Type: boolean (details)
Voorbeelden:
Hulp voor de hoofdmodule.
api.php?action=help [open in sandbox]
Alle hulp op één pagina.
api.php?action=help&recursivesubmodules=1 [open in sandbox]
Permissions:
writeapi
Via de API bewerkingen uitvoeren
Granted to: all, user en bot
apihighlimits
Use higher limits in API queries (slow queries: 500; fast queries: 5000). The limits for slow queries also apply to multivalue parameters.
Granted to: bot en sysop

Gegevenstypen

Input to MediaWiki should be NFC-normalized UTF-8. MediaWiki may attempt to convert other input, but this may cause some operations (such as edits with MD5 checks) to fail.

Some parameter types in API requests need further explanation:

boolean
Boolean parameters work like HTML checkboxes: if the parameter is specified, regardless of value, it is considered true. For a false value, omit the parameter entirely.
timestamp
Timestamps may be specified in several formats. ISO 8601 date and time is recommended. All times are in UTC, any included timezone is ignored.
  • ISO 8601 date and time, 2001-01-15T14:56:00Z (punctuation and Z are optional)
  • ISO 8601 date and time with (ignored) fractional seconds, 2001-01-15T14:56:00.00001Z (dashes, colons, and Z are optional)
  • MediaWiki format, 20010115145600
  • Generic numeric format, 2001-01-15 14:56:00 (optional timezone of GMT, +##, or -## is ignored)
  • EXIF format, 2001:01:15 14:56:00
  • RFC 2822 format (timezone may be omitted), Mon, 15 Jan 2001 14:56:00
  • RFC 850 format (timezone may be omitted), Monday, 15-Jan-2001 14:56:00
  • C ctime format, Mon Jan 15 14:56:00 2001
  • Seconds since 1970-01-01T00:00:00Z as a 1 to 13 digit integer (excluding 0)
  • The string now
alternative multiple-value separator
Parameters that take multiple values are normally submitted with the values separated using the pipe character, e.g. param=value1|value2 or param=value1%7Cvalue2. If a value must contain the pipe character, use U+001F (Unit Separator) as the separator and prefix the value with U+001F, e.g. param=%1Fvalue1%1Fvalue2.

Vermeldingen

API-ontwikkelaars:

  • Yuri Astrakhan (oorspronkelijke ontwikkelaar, hoofdontwikkelaar september 2006 – september 2007)
  • Roan Kattouw (hoofdontwikkelaar september 2007–2009)
  • Victor Vasiliev
  • Bryan Tong Minh
  • Sam Reed
  • Brad Jorsch (hoofdontwikkelaar 2013–heden)

Stuur uw opmerkingen, suggesties en vragen naar mediawiki-api@lists.wikimedia.org of maak een bugrapport aan op https://phabricator.wikimedia.org/.