API:Lists

Lists differ from other properties in two aspects - instead of appending data to the elements under 'pages' element, each list has its own separated branch under 'query' element. Also, list output is limited by number of items, and may be continued using "paging" technique. Even when no limit is provided, the query will only return a set number of items, and will also provide a string point from which to continue paging. See allpages list for an example.

allpages / ap (done)

 * Returns a list of pages in a given namespace starting at from, ordered by page title.
 * Parameters: apfrom (paging), apnamespace (dflt=0), apredirect (flt), aplimit (dflt=10, max=500/5000)

alllinks / al (done)

 * Returns a list of (unique) links to a given namespace starting at from, ordered by link title. If alunique is set, alprop=ids or generator mode is not allowed.
 * Parameters: alfrom (paging), alunique (flt), alprop=ids|title (dflt=title), alnamespace (dflt=0), allimit (dflt=10, max=500/5000)
 * Rationale: Cyrillic-based languages share many letters with latin alphabet, yet have different character codes. So even though the text looks right, the link does not work. Having this query will allow an order of magnitude improvement in finding such mixed-case links (in unique mode).

allusers / au (done)

 * Gets a list of registered users, ordered by user name.
 * Parameters: aufrom (paging), auprefix (like in allpages), auprop=editcount|groups|..., augroup, aulimit (dflt=10, max=500/5000)

backlinks / bl
Lists pages that link to the given page. Ordered by linking page title. Parameters: bltitle, blcontinue (paging), blnamespace (flt), blredirect (flt, not impl), bllimit (dflt=10, max=500/5000)

categorymembers / cm (done)

 * List of pages that belong to a given category, ordered by page sort title.
 * Parameters: cmcategory, cmprop (properties), cmcontinue (paging), cmnamespace (flt), cmlimit (dflt=10, max=500/5000)

api.php ? action=query & list=categorymembers & cmcategory=CatName

embeddedin / ei (done without redirects)

 * What pages include template:title page as a template. List of pages that include the given page using . Ordered by including page title.
 * Parameters: eititle, eicontinue (paging), einamespace (flt), eiredirect (flt, not implemented), eilimit (dflt=10, max=500/5000)

exturlusage / eu (done)

 * What pages contain a given URL (or its part)
 * Parameters: euprotocol, euquery, euoffset (paging), eunamespace (flt), eulimit (dflt=10, max=500/5000)
 * euurl must begin with one of the supported protocols (http, https, mailto, ...). The server name may begin with a '*.' in front of the server name, and the path may end with another '*'. See Special:LinkSearch for similar functionality.

imageusage / iu (done)

 * This was renamed from imagelinks (MediaWiki 1.9) in query.php, and from imgebeddedin in the earlier API version to avoid confusion. images will now be used to get all images used on a given page.

List of pages that include a given image. Ordered by page title.
 * Parameters: iutitle, iucontinue (paging), iuredirect, iunamespace (flt), iulimit (dflt=10, max=500/5000)

logevents / le (semi-complete)

 * List log events, filtered by time range, event type, user type, or the page it applies to. Ordered by event timestamp.
 * Parameters: letype (flt), lestart (paging timestamp), leend (flt), ledirection (dflt=older), leuser (flt), letitle (flt), lelimit (dflt=10, max=500/5000)

api.php ? action=query & list=logevents     - List last 10 events of any type

recentchanges / rc (done)

 * Gets a list of pages recently changed, ordered by modification timestamp.
 * Parameters: rcfrom (paging timestamp), rcto (flt), rcnamespace (flt), rcminor (flt), rcusertype (dflt=not|bot), rcdirection (dflt=older), rclimit (dflt=10, max=500/5000)

api.php ? action=query & list=recentchanges - List last 10 changes

search / sr (done)

 * Full text search in wiki

usercontribs / uc (semi-complete, needs parameter revision)

 * Gets a list of pages modified by a given user, ordered by modification time.
 * Parameters: ucuser, ucfrom (paging timestamp), ucto (flt), ucnamespace (flt), ucminor (flt), uctop (flt), ucdirection (dflt=older), uclimit (dflt=10, max=500/5000)

api.php ? action=query & list=usercontribs & ucuser=UserA  - List last 10 changes made by userA

watchlist / wl (done)

 * Get a list of pages on the user's watchlist but only if they were changed within the given time period. Ordered by time of the last change of the watched page.
 * Parameters: wlfrom (paging timestamp), wlto (flt), wlnamespace (flt), wldirection (dflt=older), wllimit (dflt=10, max=500/5000)

deletedrevs / dr

 * Ideas
 * Expose as part of revisions?

Parameters

 * titles: Pipe-separated list of titles to list deleted revisions for (optional). If not specified, all deleted revisions will be listed.
 * drstart: The timestamp to start listing from (optional). If not specified, all revisions before drend will be listed.
 * drend: The timestamp to end listing at (optional). If not specified, all revisions later than drstart will be listed.
 * drdir: Direction to list in.
 * older: List newest revisions first (default). Note: drstart has to be later than drend.
 * newer: List oldest revisions first. Note: drstart has to be before drend.
 * drnamespace: Pipe-separated list of namespace numbers to search in. By default, all namespaces will be searched.
 * drlimit: Maximum number of revisions to get. If not specified, 10 revisions will be listed.
 * drprop: A pipe-separated list of properties to get. Possible values are revid, user, comment, minor, len, content and token. The default value is user|comment.

Possible errors
All errors are formatted as:
 * code: drpermissiondenied
 * info: You don't have permission to view deleted revisions
 * On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have stricter rules.

Parameters

 * bkstart: The timestamp to start listing from (optional). If not specified, all blocks before bkend will be listed.
 * bkend: The timestamp to end listing at (optional). If not specified, all blocks later than bkstart will be listed.
 * bkdir: Direction to list in.
 * older: List newest blocks first (default). Note: bkstart has to be later than bkend.
 * newer: List oldest blocks first. Note: bkstart has to be before bkend.
 * bkids: Pipe-separated list of block IDs to list (optional). If not specified, blocks will be listed regardless of ID.
 * bkusers: Pipe-separated list of users to search for (optional). If not specified, blocks for all users will be listed.
 * bklimit: Maximum number of blocks to get. If not specified, 10 blocks will be listed.
 * bkprop: A pipe-separated list of properties to get. The default value is id|user|by|timestamp|expiry|reason|flags
 * id: The ID of the block
 * user: The IP address or username that was blocked
 * by: The user who applied the block
 * timestamp: When the block was applied
 * expiry: When the block will expire
 * reason: The reason for the block
 * range: If an IP range was blocked, the first and last IP the block applies to
 * flags: Flags that apply to the block
 * automatic: Automatically blocked because of an autoblock (see also action=block)
 * anononly: Only anonymous edits are blocked
 * nocreate: Account creation is disabled
 * autoblock: Automatic blocking is enabled for this block
 * noemail: Sending e-mail through the wiki is disabled for the blocked user
 * hidden: This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.

Sample request
TODO from here onward

Possible errors
All errors are formatted as:
 * code: drpermissiondenied
 * info: You don't have permission to view deleted revisions
 * On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have stricter rules.