MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

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

action=compare

(main | compare)

Hämta skillnaden mellan två sidor.

Ett versionsnummer, en sidtitel, ett sid-ID, text eller en relativ referens för både "from" och "to" måste godkännas.

Parametrar:
fromtitle

Första titeln att jämföra.

fromid

Första sid-ID att jämföra.

Type: integer
fromrev

Första version att jämföra.

Type: integer
fromslots

Override content of the revision specified by fromtitle, fromid or fromrev.

This parameter specifies the slots that are to be modified. Use fromtext-{slot}, fromcontentmodel-{slot}, and fromcontentformat-{slot} to specify content for each slot.

Värden (separerade med | eller alternativ): main
fromtext-{slot}

Text of the specified slot. If omitted, the slot is removed from the revision.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
fromsection-{slot}

When fromtext-{slot} is the content of a single section, this is the section number. It will be merged into the revision specified by fromtitle, fromid or fromrev as if for a section edit.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
fromcontentformat-{slot}

Content serialization format of fromtext-{slot}.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
Ett av följande värden: application/json, text/css, text/javascript, text/plain, text/x-wiki
fromcontentmodel-{slot}

Content model of fromtext-{slot}. If not supplied, it will be guessed based on the other parameters.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of fromslots.
Ett av följande värden: css, javascript, json, text, wikitext
frompst

Do a pre-save transform on fromtext-{slot}.

Type: boolean (details)
fromtext
Föråldrad.

Ange fromslots=main och använd fromtext-main istället.

fromcontentformat
Föråldrad.

Specify fromslots=main and use fromcontentformat-main instead.

Ett av följande värden: application/json, text/css, text/javascript, text/plain, text/x-wiki
fromcontentmodel
Föråldrad.

Innehållsmodell för fromtext. Om det inte anges kommer den gissas fram baserat på de andra parametrarna.

Ett av följande värden: css, javascript, json, text, wikitext
fromsection
Föråldrad.

Only use the specified section of the specified 'from' content.

totitle

Andra titeln att jämföra.

toid

Andra sid-ID att jämföra.

Type: integer
torev

Andra version att jämföra.

Type: integer
torelative

Use a revision relative to the revision determined from fromtitle, fromid or fromrev. All of the other 'to' options will be ignored.

Ett av följande värden: cur, next, prev
toslots

Override content of the revision specified by totitle, toid or torev.

This parameter specifies the slots that are to be modified. Use totext-{slot}, tocontentmodel-{slot}, and tocontentformat-{slot} to specify content for each slot.

Värden (separerade med | eller alternativ): main
totext-{slot}

Text of the specified slot. If omitted, the slot is removed from the revision.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
tosection-{slot}

When totext-{slot} is the content of a single section, this is the section number. It will be merged into the revision specified by totitle, toid or torev as if for a section edit.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
tocontentformat-{slot}

Content serialization format of totext-{slot}.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
Ett av följande värden: application/json, text/css, text/javascript, text/plain, text/x-wiki
tocontentmodel-{slot}

Content model of totext-{slot}. If not supplied, it will be guessed based on the other parameters.

This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of toslots.
Ett av följande värden: css, javascript, json, text, wikitext
topst

Do a pre-save transform on totext.

Type: boolean (details)
totext
Föråldrad.

Specify toslots=main and use totext-main instead.

tocontentformat
Föråldrad.

Specify toslots=main and use tocontentformat-main instead.

Ett av följande värden: application/json, text/css, text/javascript, text/plain, text/x-wiki
tocontentmodel
Föråldrad.

Specify toslots=main and use tocontentmodel-main instead.

Ett av följande värden: css, javascript, json, text, wikitext
tosection
Föråldrad.

Only use the specified section of the specified 'to' content.

prop

Which pieces of information to get.

diff
The diff HTML.
diffsize
The size of the diff HTML, in bytes.
rel
The revision IDs of the revision previous to 'from' and after 'to', if any.
ids
The page and revision IDs of the 'from' and 'to' revisions.
title
The page titles of the 'from' and 'to' revisions.
user
The user name and ID of the 'from' and 'to' revisions. If the user has been revision deleted, a fromuserhidden or touserhidden property will be returned.
comment
The comment on the 'from' and 'to' revisions. If the comment has been revision deleted, a fromcommenthidden or tocommenthidden property will be returned.
parsedcomment
The parsed comment on the 'from' and 'to' revisions. If the comment has been revision deleted, a fromcommenthidden or tocommenthidden property will be returned.
size
The size of the 'from' and 'to' revisions.
timestamp
(no description)
Värden (separerade med | eller alternativ): comment, diff, diffsize, ids, parsedcomment, rel, size, timestamp, title, user
Default: diff|ids|title
slots

Return individual diffs for these slots, rather than one combined diff for all slots.

Värden (separerade med | eller alternativ): main
To specify all values, use *.
Example:
Skapa en diff mellan version 1 och 2
api.php?action=compare&fromrev=1&torev=2 [open in sandbox]