You can use prop=templates as a generator and then ask for prop=info&inprop=protection to get the protection information about each template:

http://en.wikipedia.org/w/api.php?format=json&action=query&pageids=199445&generator=templates&gtllimit=500&prop=info&inprop=protection

Petr Onderka
[[en:User:Svick]]


On Fri, May 3, 2013 at 8:04 AM, Chux <chux18@gmail.com> wrote:
Hi guys,

I am trying to retrieve the templates associated to a page: http://en.wikipedia.org/w/api.php?action=query&prop=templates&format=json&tllimit=500&pageids=199445

So in this scenario, I am able to get a list, but I noticed some of the listed templates here are marked as protected. I am not able to see any attribute in the results that shows this flag.

Any ideas on how can I filter those out?

Thanks,
Chux

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api