views:

15

answers:

1

Is it possible to query the wikipedia API for articles that contain a specific Template? The docs at: http://en.wikipedia.org/w/api.php do not describe any action that would filter search results to pages that contain a template. Specifically, I am after pages that contain Template:Persondata. After that, I am hoping to be able to retrieve just that specific template in order to populate genealogy data for the openancestry.org project.

The query below shows that the Albert Einstein page contains the Persondata Template but it doesn't return the contents of the template and I don't know how to get a list of page titles that contain the template. http://en.wikipedia.org/w/api.php?action=query&prop=templates&titles=Albert%20Einstein&tlcontinue=736|10|ParmPart

Returns:

<api>
 <query>
  <pages>
   <page pageid="736" ns="0" title="Albert Einstein">
    <templates>
     ...
     <tl ns="10" title="Template:Persondata"/>
     ...
    </templates>
   </page>
  </pages>
 </query>
 <query-continue>
  <templates tlcontinue="736|10|Reflist"/>
 </query-continue>
</api>

I suspect that I can't get what I need from the API but I'm hoping I'm wrong and that someone has already blazed a trail down this path.