From MediaWiki.org
(Redirected from API:Query - Lists)
Jump to navigation Jump to search

Other languages:
Deutsch • ‎English • ‎dansk • ‎español • ‎français • ‎polski • ‎română • ‎русский • ‎українська • ‎العربية • ‎ไทย • ‎中文 • ‎日本語 • ‎한국어

Lists differ from properties in two aspects - instead of appending data to the elements in the pages element, each list has its own separated branch in the query element. To use the list API, specify action=query&list=list1|list2|... in the URL. Also, list output is limited by number of items, and may be continued using the query-continue element. Unless indicated otherwise, modules listed on this page can be used as generators.


Browse all in a single page


All list queries return a limited number of results. This limit is 10 by default, and can be set as high as 500 for regular users, or 5000 for users with the apihighlimits right (typically bots and sysops). The limit parameter for a given module consists of the module prefix followed by limit, so ptlimit is the maximum number of protectedtitles returned, and cmlimit is the maximum number of categorymembers returned. Some modules impose stricter limits under certain conditions. If you're not sure which limit applies to you and just want as many results as possible, set the limit to max. In that case, a <limits> element will be returned, specifying the limits used.


If you set the limit to a value higher than the maximum, a warning will be thrown, which looks like:

Code Info
allpages aplimit may not be over 500 (set to 1000) for users.

ap can be replaced with any other module prefix. The ap prefix corresponds to the list=allpages parameter


Getting the maximum amount of revisions with content and backlinks for w:Winnipeg, Manitoba