API:Allcategories
Jump to navigation
Jump to search
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- 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
| 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