API:Watchlist
From MediaWiki.org
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Create and edit pages
- Move pages
- Merge pages
- Rollback
- Delete pages
- Restore deleted revisions
- (Un)protect pages
- (Un)block users
- (Un)watch pages
- Mark revisions of watched pages as visited
- Send email
- Patrol changes
- Import pages
- Change user group membership
- Upload files
- User options
- Tokens
- Page language
- More...
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| Watchlist | ||
|---|---|---|
This module can be used as a Generator. |
||
| Prefix | wl | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Get a list of pages on the current user's watchlist that were changed within the given time period. Ordered by time of the last change of the watched page.
Parameters[edit]
wlallrev: Include multiple revisions to the same page.wlstart: The timestamp to start listing from. Prior to version 1.23, this parameter is used as the continue parameter.wlend: The timestamp to end listing atwlnamespace: Only list pages in these namespaceswluser: Only list changes made by this user 1.16+wlexcludeuser: Do not list changes made by this user 1.16+wldir: Direction to list in (Default:older)older: List most recently changed pages first. Note:wlstartmust be later thanwlend.newer: List least recently changed pages first. Note:wlstartmust be earlier thanwlend.
wllimit: Maximum amount of pages to list No more than 500 (5000 for bots) allowed. (Default: 10)wlprop: Which properties to get (Default:ids|title|flags)ids: The page ID and revision ID 1.11+title: The title the change was made to 1.11+flags: Flags for the edit (anon, bot, new, minor) 1.11+user: The user who made the changeuserid: The id of the user who made the change 1.17+comment: The edit/log commentparsedcomment: The edit/log comment in HTML format with wikilinks and section references expanded into hyperlinks 1.16+timestamp: The time and date of the changepatrol: Whether the change is patrolled. Only available to users with thepatrolrightsizes: The page size before and after the change 1.11+notificationtimestamp: Adds timestamp of when the user was last notified about the edit 1.16+loginfo: Adds log information where appropriate 1.18+
wlshow: Only list revisions that meet these criteria. Conflicting options (such asminorand!minor) cannot be used together 1.12+minor: Only list minor edits!minor: Don't list minor editsbot: Only list bot edits!bot: Don't list bot editsanon: Only list edits by anonymous users!anon: Only list edits by registered userspatrolled: Only list patrolled edits 1.14+!patrolled: Only list unpatrolled edits 1.14+unread: Only list unread edits 1.24+!unread: Only list already read edits 1.24+
wltype: Only list certain types of changes 1.22+edit: Regular page editsexternal: External editsnew: Page creationslog: Log entries
wlowner: The user whose watchlist you want (must be accompanied bywltokenif it's not the currently logged-in user). Remember that using format=json with callback is always in a logged-out environment, meaningwltokenis required even if it's for the supposedly current logged-in user. 1.16+wltoken: Security token that thewlownerhas set in their preferences 1.16+wlcontinue: When more results are available, use this to continue 1.23+
Example[edit]
Get the current user's watchlist
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query>
<watchlist>
<item pageid="16396" revid="176417" ns="0" title="API:Query - Lists" />
<item pageid="25300" revid="176413" ns="1" title="Talk:Summer of Code 2008" />
<item pageid="24947" revid="176089" ns="0" title="Summer of Code 2008" />
<item pageid="16377" revid="174495" ns="0" title="API:Query" />
<item pageid="16393" revid="174239" ns="0" title="API:Query - Meta" minor="" />
<item pageid="16375" revid="174222" ns="0" title="API:Login" />
<item pageid="16391" revid="174216" ns="0" title="API:Data formats" minor="" />
<item pageid="14588" revid="174214" ns="0" title="API" />
<item pageid="18710" revid="173571" ns="1" title="Talk:API:Edit - Create&Edit pages" />
<item pageid="20025" revid="173412" ns="1" title="Talk:API:Query" />
</watchlist>
</query>
</api>
|
Error Codes[edit]
| Code | Info |
|---|---|
| wlnotloggedin | You must be logged-in to have a watchlist |
| wlpatrol | patrol property is not available |
| wlshow | Incorrect parameter - mutually exclusive values may not be supplied |