0

I want to download the template source used in a wikipedia page (basically for generating the display text of a key). SO i am basically want this info

http://en.wikipedia.org/w/index.php?title=Template:Infobox%20cricketer&action=edit

for Template:Infobox cricketer

I have found an api for wikipedia called Template data

http://www.mediawiki.org/wiki/Extension:TemplateData

But the examples given:

http://en.wikipedia.org/w/api.php?action=templatedata&titles=Template:Stub

does not seem to work.

svick
  • 236,525
  • 50
  • 385
  • 514
Arun
  • 645
  • 7
  • 16

1 Answers1

3

I think you misunderstood what Extension:TemplateData is for. It's for getting metadata about a template, which only works if that template provides those metadata.

If what you want the text of the template, you should use prop=revisions&rvprop=content, for example:

http://en.wikipedia.org/w/api.php?action=query&titles=Template:Infobox%20cricketer&prop=revisions&rvprop=content

svick
  • 236,525
  • 50
  • 385
  • 514