Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a list of MediaWiki namespaces?

How do I get a list of MediaWiki namespaces? Ideally with name and number.

like image 338
kqw Avatar asked Jul 02 '14 22:07

kqw


People also ask

What are MediaWiki namespaces?

Pages on a MediaWiki wiki are grouped into collections called “namespaces” which differentiate between the purpose of the pages at a high level. Pages in certain namespaces can also have special properties or behave differently when they interact with other pages.

What is Wikipedia namespace?

A Wikipedia namespace is a set of Wikipedia pages whose names begin with a particular reserved word recognized by the MediaWiki software (followed by a colon). For example, in the user namespace all titles begin with the prefix User:.

Is Wikipedia API free?

Wikipedia and other Wikimedia projects are free, collaborative repositories of knowledge, written and maintained by volunteers from around the world. The Wikimedia API gives you open access to add this free knowledge to your projects and apps.

Is Wikipedia a MediaWiki?

MediaWiki is a free and open-source wiki software. It is used on Wikipedia and almost all other Wikimedia websites, including Wiktionary, Wikimedia Commons and Wikidata; these sites define a large part of the requirement set for MediaWiki.


1 Answers

Use the API: api.php?action=query&meta=siteinfo&siprop=namespaces

For example: http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

XML with list of Wikipedia namespaces

You can also get other formats such as JSON.

See also MediaWiki documentation for more info

like image 116
kqw Avatar answered Oct 14 '22 06:10

kqw