8

I want to download the wikicode of this Wikipedia article with a single Web request.

Is there any better way than getting https://en.wikipedia.org/w/index.php?title=Paris&action=edit and filtering the content of the <textarea>?

In particular, how to do this with the REST API?

7

Passing action=raw is the best way to obtain just the wikitext of a page, although it can be done with the API. See https://en.wikipedia.org/w/index.php?title=Paris&action=raw for example and the MediaWiki docs.

0

You can export the wikicode in XML format.

Source:

https://en.wikipedia.org/wiki/Help:Export

https://en.wikipedia.org/wiki/Help:Downloading_pages#Downloading the wikitext of a page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.