superhero
superhero

Reputation: 305

How to get extracts of revisions of wikipedia articles

I would like to get extracts for old versions (revisions) of wikipedia articles. This question shows how to get the content in a json format. In particular it uses prop=extracts then explaintext= to return the content. I would like to do the same but for a revision (using revid=*) of an article.

Upvotes: 1

Views: 145

Answers (1)

Daniel Trebbien
Daniel Trebbien

Reputation: 39208

This is not possible using only TextExtracts. See RFE T66546 Support revisions, which was declined. In fact, if you try to specify revids instead of titles, then TextExtracts will return the extract(s) for the current revision(s) of the corresponding title(s). For example:
action=query&prop=extracts&exchars=100&explaintext&revids=342428310
has equivalent output to:
action=query&prop=extracts&exchars=100&explaintext&titles=Earth

You would need to figure out how TextExtracts prepares an extract and do the same for the revision of interest.

Upvotes: 1

Related Questions