API:Allcategories
Jump to navigation
Jump to search
| This page is part of the MediaWiki Action API documentation. |
| Please help improve this technical documentation! Take our MediaWiki Action API Technical Documentation User Feedback Survey before 6 January – Note: The survey uses Google Forms. See Privacy Statement – Thanks! |
| Allcategories | ||
|---|---|---|
| Get a list of all categories. This module can be used as a Generator. |
||
| Prefix | ac | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Get a list of all categories. This differs from list=allpages&alnamespace=14 in that categories without descriptions will be listed, while redirects and pages where the category was never used will not. Note: the allcategories list includes categories that were previously used but have since been deleted. It is recommended that the list be filtered to those where the size is greater than zero or the category page exists.
Contents
Parameters[edit]
acfrom: The category to start enumerating fromacto: The category to stop enumerating atacprefix: Search for all category titles that begin with this valueacdir: Direction to sort in (Default: ascending)ascending: List from A to Zdescending: List from Z to A
acmin: Minimum number of category membersacmax: Maximum number of category membersaclimit: How many categories to return. No more than 500 (5000 for bots) allowed. (Default: 10)acprop: Which properties to get (Default: none)size: Adds number of pages in the category- : Tags categories that are hidden with __HIDDENCAT__
Example[edit]
List the first 10 categories whose name starts with "List of"
| Result |
|---|
<?xml version="1.0"?>
<api>
<query>
<allcategories>
<c xml:space="preserve">List of "M" series military vehicles</c>
<c xml:space="preserve">List of 1999 ballet premieres</c>
<c xml:space="preserve">List of 19th century baseball players</c>
<c xml:space="preserve">List of 2000s one-hit wonders in the United States</c>
<c xml:space="preserve">List of 2006</c>
<c xml:space="preserve">List of 20th-century classical composers</c>
<c xml:space="preserve">List of 20th-century classical composers by birth date</c>
<c xml:space="preserve">List of 20th Century fox films</c>
<c xml:space="preserve">List of 20th century classical composers</c>
</allcategories>
</query>
<query-continue>
<allcategories acfrom="List of 20th century classical composers by birth date" />
</query-continue>
</api>
|
Error Codes[edit]
None