API:Categories

From MediaWiki.org
Jump to: navigation, search

Gets a list of all categories used on the provided pages. This module can be used as a generator.

Parameters[edit]

  • clprop: Which properties to get.
    • sortkey: The sort key.
    • timestamp: The date and time the page was added to the category, or the date and time its sortkey was changed last. 1.13+
    • hidden: Whether the category is hidden or not. 1.16+
  • clshow: Which kinds of categories to list. Conflicting options (such as hidden and !hidden) cannot be used together. 1.14+
    • hidden: Only list hidden categories.
    • !hidden: Don't list hidden categories.
  • cllimit: Maximum number of results to return. 1.13+
  • clcontinue: When more results are available, use this to continue. 1.13+
  • clcategories: Only list these categories. Useful to check whether a certain page is in a certain category. Note: This parameter takes full titles, so the Category: prefix must be used. 1.15+
  • cldir: The direction in which to list. Possible values: ascending, descending. (Default: ascending) 1.20+

Example[edit]

Get a list of categories en:Albert Einstein belongs to

Possible warnings[edit]

  • 'title' is not a category
    • The title mentioned is not in the Category: namespace

Possible errors[edit]

Code Info
clshow Incorrect parameter - mutually exclusive values may not be supplied