API:Allpages
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
| Allpages | ||
|---|---|---|
This module can be used as a Generator. |
||
| Prefix | ap | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Returns a list of pages in a given namespace, ordered by page title.
apfrom: Start listing at this title. The title need not exist.apto: The page title to stop enumerating atapprefix: Only list titles that start with this valueapnamespace: 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. (Default: 0)apfilterredir: How to filter redirects (Default:all)all: List all pages regardless of their redirect flagredirects: Only list redirectsnonredirects: Don't list redirects
apfilterlanglinks: How to filter based on whether a page has language links (Default:all)all: List all pages regardless of whether they have language linkswithlanglinks: Only list pages with language linkswithoutlanglinks: Only list pages without language links
apminsize: Only list pages that are at least this many bytes in sizeapmaxsize: Only list pages that are at most this many bytes in sizeapprtype: Only list pages that have been protected from this type of actionedit: Only list edit-protected pagesmove: Only list move-protected pages
apprlevel: Only list pages that have been protected at this level. Cannot be used withoutapprtypeautoconfirmed: Only autoconfirmed users can edit/move/whateversysop: Only sysops can edit/move/whatever
aplimit: Maximum amount of pages to list. (Default: 10)apdir: In which direction to list (Default:ascending) 1.12+ascending: List from A to Zdescending: List from Z to A
apprfiltercascade: Filter protections based on cascadingness (ignored whenapprtypeisn't set). Possible values:cascading,noncascading,all. (Default:all)apprexpiry: Which protection expiry to filter the page on (Default:all)indefinite: Get only pages with indefinite protection expirydefinite: Get only pages with a definite (specific) protection expiryall: Get pages with any protections expiry
Example[edit]
Show a list of first 5 pages starting from "Kre"
| Result |
|---|
<api>
<query-continue>
<allpages apfrom="Kreatel" />
</query-continue>
<query>
<allpages>
<p pageid="1756320" ns="0" title="Kre'fey" />
<p pageid="3361042" ns="0" title="Kreab" />
<p pageid="288613" ns="0" title="Kreacher" />
<p pageid="812540" ns="0" title="Kreamer, PA" />
<p pageid="133750" ns="0" title="Kreamer, Pennsylvania" />
</allpages>
</query>
</api>
|
Show a list of first 3 categories (Namespace id = 14) starting at Ab...
| Result |
|---|
<?xml version="1.0"?>
<api>
<query>
<allpages>
<p pageid="18263532" ns="14" title="Category:Ab instruments" />
<p pageid="27037875" ns="14" title="Category:Abaco Islands" />
<p pageid="16839157" ns="14" title="Category:Abacus" />
</allpages>
</query>
<query-continue>
<allpages apcontinue="Abad_Santos_family" />
</query-continue>
</api>
|
Error Codes[edit]
- 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