Search code examples
mediawikimediawiki-api

MediaWiki: How to resolve "descriptionmsg" value retrieved via API?


Via http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions you can retrieve information about the MediaWiki extensions installed. The result format is documented at https://www.mediawiki.org/wiki/API:Siteinfo and states that for each extension descriptionmsg contains a system message name. This is not the description itself but a key to a description string.

My question is: I have the key from descriptionmsg, now how do I obtain the description string (via the API)?


Solution

  • MediaWiki has an API module in its action API called allmessages, it can be called like https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc

    Check out its documentation here: https://www.mediawiki.org/wiki/API:Allmessages