API:Categoryinfo
Jump to navigation
Jump to search
| Categoryinfo | ||
|---|---|---|
| Returns information about the given categories. This module cannot be used as a Generator. |
||
| Prefix | ci | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Gets information about categories
- Note
- If the category page exists, but the category has no members, a "categoryinfo" field will not be included in the API response.
Parameters[edit]
cicontinue: When more results are available, use this to continue.
Example[edit]
Get info about a few categories
api.php? action=query& titles=Albert%20Einstein|Category:Foo|Category:Infobox%20templates& prop=categoryinfo [try in ApiSandbox]
| Result |
|---|
{
"batchcomplete": "",
"query": {
"pages": {
"-1": {
"ns": 14,
"title": "Category:Foo",
"missing": ""
},
"736": {
"pageid": 736,
"ns": 0,
"title": "Albert Einstein"
},
"3108204": {
"pageid": 3108204,
"ns": 14,
"title": "Category:Infobox templates",
"categoryinfo": {
"size": 2054,
"pages": 2038,
"files": 0,
"subcats": 16
}
}
}
}
}
|
Possible errors[edit]
None.
| The following documentation is the output of Special:ApiHelp/query+categoryinfo, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
prop=categoryinfo (ci)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Returns information about the given categories.
Parameter:
- cicontinue
When more results are available, use this to continue.
Example:
- Get information about Category:Foo and Category:Bar.
- api.php?action=query&prop=categoryinfo&titles=Category:Foo|Category:Bar [open in sandbox]