Jump to content

API talk:Compare

About this board

prop parameter should have tags

1
Plantaest (talkcontribs)
Reply to "prop parameter should have tags"

How to get diff format like in mobile version (Minerva skin)?

3
Plantaest (talkcontribs)

Can this api do that job (to get inline diff)?

Plantaest (talkcontribs)
Plantaest (talkcontribs)

Now (2024), this API had inline diff type.

Reply to "How to get diff format like in mobile version (Minerva skin)?"

is there a way to compare pages from two sites in a wiki family?

3
122.199.13.215 (talkcontribs)

either API or special:comparepage


thanks.

132.234.229.82 (talkcontribs)

try to put fqdn of two pages (off two sites in a family), it doesn't come up with anything.


anyone knows if this is possible?

C holtermann (talkcontribs)
Reply to "is there a way to compare pages from two sites in a wiki family?"

How to get Visual diff from API:Compare?

1
Xinbenlv (talkcontribs)
Reply to "How to get Visual diff from API:Compare?"

Uncaught ReferenceError: request is not defined

1
WikiMacaroons (talkcontribs)

I've tried the sample javascript code on the API page but it returns

Uncaught ReferenceError: request is not defined

I tried requiring the request, but it just tells me the requirement is not defined. Can someone help please?

Reply to "Uncaught ReferenceError: request is not defined"

Can multiple diffs be fetched with a single API request?

1
Enterprisey (talkcontribs)

Also interested in methods using the replicas on Wikimedia Toolforge, although I don't think that route is possible.

Reply to "Can multiple diffs be fetched with a single API request?"

Relative comparison at first and last revision

1
EvanProdromou (talkcontribs)

You can ask for a relative comparison to prev at the first revision of a page:


https://en.wikipedia.org/w/api.php?action=compare&fromrev=14189795&torelative=prev


This will result in the full text of the first revision being returned as the diff. Note that this is not accurate, since in some cases there may be default content for the page before its first revision. The fromrevid property will be absent from the results.


Similarly, you can ask for the next relative comparison on the last revision of a page:

https://en.wikipedia.org/w/api.php?action=compare&fromrev=874792395&torelative=next


(Note: this is the last revision as of the writing of this topic. Because the page is protected, it probably should not change.) The result is an empty diff, and the torevid will be absent. Unlike most revision comparisons, these results will change if a new revision is created.

This behaviour in the API is historical. It isn't consistent with the conceptual model of page history as a series of revisions. There is no "previous" revision to compare against the first revision, nor is there a "next" revision to compare against the last. Because of this, future versions of MediaWiki may give different results for this API call.

Reply to "Relative comparison at first and last revision"

First diff of a wikibase-item

2
MisterSynergy (talkcontribs)

Does anyone know how to retrieve the very first diff of a wikibase-item (Wikidata item) using action=compare, i.e. the diff of the item creation? fromrev=0 does not work, and I don’t manage to find a way with fromtext (and fromcontentmodel and fromcontentformat; non-functional example: ).

MisterSynergy (talkcontribs)

My question was answered here at Wikidata, in case anyone is interested.

Reply to "First diff of a wikibase-item"

"prop" parameter doesn't work

2
129.174.114.39 (talkcontribs)

When included in the query I'm getting this warning: "Unrecognized parameter: prop."

RobinHood70 (talkcontribs)

You've probably got a lower version of MediaWiki. That was only added very recently. I've updated the version numbers on the page to make it easier to tell.

Reply to ""prop" parameter doesn't work"
There are no older topics