5

I'm looking at the API documentation here,

https://www.mediawiki.org/wiki/API:Query

Getting the wikitext for a page is mentioned in the beginning of the documentation,

The action=query module allows you to get information about a wiki and the data stored in it, such as the wikitext of a particular page, the links and categories of a set of pages, or the token you need to change wiki content.

but I cant seem to figure out what parameters to pass in the API request to return the wikitext for a given page. Anyone know how to do this?

I've tried parameters like,

{'action':'query', 'titles':'Anarchism', 'prop':'wikitext', 'format':'json'}
Gabriel
  • 10,524
  • 1
  • 23
  • 28
  • I've tried this query. https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&formatversion=2&titles=Anarchism – Şafak Çıplak Apr 21 '19 at 01:07

1 Answers1

2

You must use this query .

   https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Anarchism&rvslots=main
Şafak Çıplak
  • 889
  • 6
  • 12