Add data from the "ProtectedPages" special page to the API
Open, LowPublic

Description

Is it possible to make the list of protected pages accessible through the API depending on the community?

Lofhi created this task.Feb 22 2018, 4:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 22 2018, 4:07 PM
Lofhi triaged this task as Low priority.Feb 22 2018, 4:07 PM
Lofhi renamed this task from Add data from the "Protected pages" special page to the API to Add data from the "ProtectedPages" special page to the API.

You can use action=query&list=allpages with apprtype= and apprlevel= to find the protected pages.

The timestamp, reason and user may not part of the api yet.

https://www.mediawiki.org/w/api.php?modules=query+allpages

Lofhi added a comment.Feb 22 2018, 6:54 PM

You can use action=query&list=allpages with apprtype= and apprlevel= to find the protected pages.

The timestamp, reason and user may not part of the api yet.

https://www.mediawiki.org/w/api.php?modules=query+allpages

Oops... I hadn't noticed. On the other hand, all information is effectively not provided via the API, it would be nice if it were available.

Anomie added a subscriber: Anomie.Feb 22 2018, 9:18 PM

Something like https://en.wikipedia.org/w/api.php?action=query&generator=allpages&gapprtype=edit&prop=info&inprop=protection gets you the protection levels and expiry, you're just missing the timestamp, user, and reason. If that were to be added, it'd probably make most sense to add an inprop.

Change 413473 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiQueryInfo: Add inprop=protectedby|protectionreason

https://gerrit.wikimedia.org/r/413473

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Feb 22 2018, 9:23 PM
Anomie claimed this task.