API:Allpages

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.8

Returns a list of pages in a given namespace, ordered by page title.

Parameters[edit | edit source]

  • apfrom: Start listing at this title. The title need not exist
  • apprefix: Only list titles that start with this value
  • apnamespace: The id of the namespace to enumerate (see API:Meta to get the list and the ids of the namespaces). You can only enumerate one namespace at a time. By default, the main namespace will be enumerated
  • apfilterredir: How to filter redirects
    • all: List all pages regardless of their redirect flag (default)
    • redirects: Only list redirects
    • nonredirects: Don't list redirects
  • apfilterlanglinks: How to filter based on whether a page has language links
    • all: List all pages regardless of whether they have language links (default)
    • withlanglinks: Only list pages with language links
    • withoutlanglinks: Only list pages without language links
  • apminsize: Only list pages that are at least this many bytes in size
  • apmaxsize: Only list pages that are at most this many bytes in size
  • apprtype: Only list pages that have been protected from this type of action
    • edit: Only list edit-protected pages
    • move: Only list move-protected pages
    • Other wikis may allow for more kinds of protection and will therefore provide more options here
  • apprlevel: Only list pages that have been protected at this level. Cannot be used without apprtype
    • autoconfirmed: Only autoconfirmed users can edit/move/whatever
    • sysop: Only sysops can edit/move/whatever
    • Empty: Everyone can edit/move/whatever
    • Other wikis may allow protection on more levels and will therefore provide more options here
  • aplimit: Maximum amount of pages to list. Default 10, must be between 1 and 500.
  • apdir: In which direction to list
    • ascending: List from A to Z (default)
    • descending: List from Z to A

Example[edit | edit source]

Show a list of first 5 pages starting from "Kre"

Show a list of first 3 categories (Namespace id = 14) starting at Ab...

Error Codes[edit | edit source]

  • Unrecognized parameter
    • info: when using allpages as a generator instead of just a list, add a g to the start of its parameter names. E.g. "gapnamespace" instead of "apnamespace"
  • code: apparams
    • info: Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator
  • code: apparams
    • info: prlevel may not be used without prtype

See also[edit | edit source]