Page MenuHomePhabricator

Expose "actual watchers" as in "action=info" via API call {action: query, prop: info}
Closed, ResolvedPublic


this is a recently (as in 1.26wmf13) added enhancement to action=query, which is not yet available via API.
the field is called "visitedWatchers", and should probably require both new inprop value, as well as output field.

see T51506.


Event Timeline

Kipod created this task.Jul 9 2015, 7:50 PM
Kipod raised the priority of this task from to Needs Triage.
Kipod updated the task description. (Show Details)
Kipod added a project: MediaWiki-API.
Kipod added a subscriber: Kipod.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 9 2015, 7:50 PM
Harej added a subscriber: Harej.Jul 9 2015, 7:56 PM

This metric will help me generate a more meaningful WikiProject Watchers report

Further, having this information will help me evaluate the outcomes of my WikiProject work – using raw watchers is an unreliable metric, since some WikiProjects are several years old and have watchers who haven't edited in years.

Therefore, I would be happy to see "actual watcher" information exposed via the API. Thank you.

Restricted Application added a subscriber: Luke081515. · View Herald TranscriptJul 9 2015, 8:10 PM
MZMcBride triaged this task as Medium priority.Jul 9 2015, 10:08 PM
MZMcBride added a project: good first task.
MZMcBride set Security to None.
MZMcBride added a subscriber: MZMcBride.
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Jul 10 2015, 1:48 PM
Kipod added a comment.Jul 13 2015, 3:24 PM

whoever closes this ticket - i think it may be good idea to redefine it as:

all data available via


should be available via api call


whenever possible.
this will add a bunch of new "inprop" values, and should not affect any existing code not using those new values.


Anomie added a subscriber: Anomie.Jul 13 2015, 5:13 PM

Looking through it:

  • "Redirect target" is T31115.
  • "Default sort key" could be added easily enough, although when it's non-default it's already available from &prop=pageprops as 'defaultsort'.
  • "Page ID" isn't necessary from prop=info, since it's automatically returned by action=query itself.
  • "Indexing by robots" could be added, although it would have to duplicate much of the logic from Article::getRobotPolicy() to avoid having to instantiate 5000 Article objects.
  • "Number of redirects to this page" I'm not sure is terribly useful, if someone cares they could probably do better using prop=redirects.
  • "Counted as a content page" could be difficult to do efficiently since it requires loading the Content object.
  • "Number of subpages of this page" I'm not sure is terribly useful, if someone cares they could probably do better using list=allpages&apprefix=... (if meta=siteinfo reports the namespace has subpages enabled).
  • Category information is available from prop=categoryinfo.
  • Most of the edit history stuff is likely better done with prop=revisions. Total authors is prop=contributors. Recent bits, probably list=recentchanges&rctitle=...
  • "Magic words" are in prop=pageprops.
  • "Hidden categories" are prop=categories.
  • "Transcluded templates" is prop=templates.
  • "Pages transcluded on" is prop=transcludedin.
  • A hook parallel to 'InfoAction' could be useful, although some of it (e.g. the page image) are better done via their existing prop modules (e.g. prop=pageimage).
Teles added a subscriber: Teles.Aug 14 2015, 3:27 AM
Sn1per claimed this task.Jan 8 2016, 10:13 PM
Sn1per moved this task from Needs Code to In Dev on the MediaWiki-API board.

Change 263162 had a related patch set uploaded (by Sn1per):
Expose visitedwatchers to API through action=query&prop=info

Change 263162 merged by jenkins-bot:
Expose visitingwatchers to API through action=query&prop=info

Anomie closed this task as Resolved.Jan 27 2016, 5:56 PM

Change 274966 had a related patch set uploaded (by Krinkle):
api: Avoid bad query when $unwatchedPageThreshold is not set

Change 274966 abandoned by Krinkle:
api: Avoid bad query when $unwatchedPageThreshold is not set

Nemo_bis rescinded a token.Jul 16 2016, 8:00 AM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJul 16 2016, 8:00 AM