API:Watchlist
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
Quick overview:
- Quick start guide
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Search suggestions
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
watchlist / wl[edit | edit source]
| MediaWiki version: | 1.11 |
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
wlstart: The timestamp to start listing fromwlend: The timestamp to end listing atwldir: Direction to list inolder: List most recently changed pages first (default). Note:wlstarthas to be later thanwlend.newer: List least recently changed pages first. Note:wlstarthas to be beforewlend.
wllimit: Maximum amount of pages to list (10 by default)wlnamespace: Only list pages in these namespaceswluser: Only list changes made by this userwlexcludeuser: Do not list changes made by this userwlowner: 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) (New in 1.17. Added in r66539)wltoken: Security token that thewlownerhas set in their preferences. (Note: New in 1.17. Added in r66539)wlallrev: Include multiple revisions to the same page. This parameter cannot be used in generator modewltype: Only list certain types of changes (available from MW1.22wmf4)edit: Regular page editsexternal: External editsnew: Page creationslog: Log entries
wlshow: Only list revisions that meet these criteria. Conflicting options (such asminorand!minor) cannot be used togetherminor: 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 users
wlprop: Which properties to getuser: The user who made the changecomment: The edit/log commentparsedcomment: The edit/log comment in HTML format with wikilinks and section references expanded into hyperlinks (New in 1.16. Added in r61761)timestamp: The time and date of the changenotificationtimestamp: Adds timestamp of when the user was last notified about the edittitle: The title the change was made to (default)ids: The page ID and revision ID (default)sizes: The page size before and after the changepatrol: Whether the change is patrolled. Only available to users with thepatrolrightflags: (default)new: A new page was createdminor: The change was a minor editbot: The change was a bot editanon: The change was made by a user who wasn't logged in
Example
Get the current user's watchlist
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <watchlist wlstart="2008-03-04T16:01:48Z" /> </query-continue> <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> |
Possible errors
- code: wlnotloggedin
- info: You must be logged-in to have a watchlist
- code: wlpatrol
- info: patrol property is not available
- code: wlshow
- info: Incorrect parameter - mutually exclusive values may not be supplied