Last modified: 2011-11-08 11:17:59 UTC
For example http://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmnamespace=14 return <?xml version="1.0"?> <api> <query-continue> <categorymembers cmcontinue="page|41544f4d4f534349454e4345|30157604" /> </query-continue> <query> <categorymembers /> </query> </api>
Confirmed. With &cmlimit=max, it does return values. Setting cmlimit to 500 works, too, but cmlimit=5 or 50 still returns empty results (with a cmcontinue). Interestingly, using cmtype=subcat instead of cmnamespace does return some 10 subcategories plus a cmcontinue. Using cmtype + cmlimit=max returns all subcategories. https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmtype=subcat https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmtype=subcat&cmlimit=max Why can't cmnamespace=14 be translated on the fly by the API into cmtype=subcat and be treated the same? (And ditto for cmnamespace=6 -> cmtype=file.) (To the OP: on cmtype, see http://lists.wikimedia.org/pipermail/mediawiki-api-announce/2011-October/000025.html )
Oh, now I see, thanks :) http://www.mediawiki.org/wiki/API:Categorymembers is outdated
This an artefact of the weird way in which cmnamespace works. When using cmnamespace, you may get responses with fewer results than you were expecting, or even zero results. Following the continue value will eventually get you to the results you were looking for. This is weird, but it has to be this way for performance reasons. Instead of cmnamespace=14, you should use the newer cmtype=subcat, which doesn't have this problem. Similarly, cmtype=file replaces cmnamespace=6.