API:Random

From MediaWiki.org
Jump to: navigation, search

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎français • ‎Հայերեն • ‎日本語 • ‎português • ‎português do Brasil • ‎русский • ‎sicilianu
Tools clipart.png This page is part of the MediaWiki action API documentation.
MediaWiki APIsAPI:Main page

MediaWiki action API

v · d · e

Get a list of random pages.

Pages are listed in a fixed sequence, only the starting point is random. This means that if, for example, "Main Page" is the first random page on your list, "List of fictional monkeys" will always be second, "List of people on stamps of Vanuatu" third, etc.

If the number of pages in the namespace is lower than rnlimit, you will get fewer pages. You will not get the same page twice.

Parameters[edit]

  • rnlimit: Limit how many random pages will be returned. No more than 10 (20 for bots) allowed. (Default: 1)
  • rnnamespace: Only list pages in these namespaces. (Default: all namespaces)
  • rnredirect: Load a random redirect instead of a random page. (Default: false) 1.14+ (Deprecated in 1.26)
  • rnfilterredir: How to filter for redirects. Possible values: all, redirects, nonredirects. (Default: nonredirects) 1.26+


Example[edit]

Get 5 random pages


Possible errors[edit]

None