API talk:Categorymembers

From mediawiki.org
Latest comment: 10 months ago by עלי in topic a better response schema

Namespace Property[edit]

For the cmnamespace property, does it take the namespace's number of its name? --(Havvy) 97.120.59.79 01:12, 17 September 2012 (UTC)Reply[reply]

It takes one or more numbers: for example, cmnamespace=0|1|2|3. --R'n'B (talk) 11:47, 18 September 2012 (UTC)Reply[reply]

Typo in properties?[edit]

I scratched my head on using this on Wikimedia Commons, but then found that properties such cmtype are actually named gcmtype. -- (talk) 10:07, 27 August 2013 (UTC)Reply[reply]

This is standard for any property retrieved using "generator=foo" as opposed to "titles=foo|bar". See API:Query#Generators for details. --R'n'B (talk) 01:40, 3 September 2013 (UTC)Reply[reply]

Commons: gcmprop[edit]

This seems to be stuck on default (ids|titles) and does not provide any other returns. Example where timestamp is a requested property but not returned. -- (talk) 22:42, 28 August 2013 (UTC)Reply[reply]

Wikiget[edit]

Search a for a page title in a specific category.[edit]

Are we able to query for a keyword under a given category? For example, I would like to query for space until the category keyboard.— Preceding unsigned comment added by 148.75.250.118 (talkcontribs) 21:53, 27 May 2017

Abnormal skip in TOC numbering (corrected)[edit]

2.1=>2.6 2.6=>2.11

    1 API documentation
    2 Examples
        2.1 Example 1: List twenty pages in a category
            2.1.1 GET request
            2.1.2 Response
            2.1.3 Sample code
        2.6 Example 2: Get the ten articles most recently added to a category
            2.6.1 GET request
            2.6.2 Response
            2.6.3 Sample code
        2.11 Example 3: Get ten subcategories of a category
            2.11.1 GET request
            2.11.2 Response
            2.11.3 Sample code
    3 Possible errors
    4 Parameter history
    5 See also

refer to => https://www.mediawiki.org/wiki/Topic:V80j0jclibtkd7g4

Christian FR (talk) 21:59, 14 November 2019 (UTC)Reply[reply]

What is the value for PARAM:"cmcontinue":[edit]

I can put value for "cmlimit":50. For "cmcontinue":"?"--Info-farmer (talk) 05:31, 16 February 2020 (UTC)Reply[reply]

PARAMS = {
    "action": "query",
    "cmtitle": "Category:Physics",
    "cmlimit": "20",
    "cmcontinue":"21",
    "list": "categorymembers",
    "format": "json"
}

but i am getting the error:

   "KeyError: 'query' "

how can i solve this issue?--Info-farmer (talk) 07:02, 17 February 2020 (UTC)Reply[reply]

  • cmcontinue is not a count. Observe that the original query includes in its json response a value for cmcontinue. That exact value is the one you need to pass in the cmcontinue parameter when making a subsequent query (to continue the query). --Clump (talk) 12:28, 17 February 2020 (UTC)Reply[reply]
    • when i print "DATA = R.json()", i understand my mistake. Thanks indeed for your explanation.--Info-farmer (talk) 01:30, 18 February 2020 (UTC)Reply[reply]

a better response schema[edit]

It would be better if the main response schema would look something like:

"query": {
	"categorymembers": {
		"<cmtitle/cmpageid>": [
			...
		]
	}
}

עלי (talk) 17:00, 16 July 2022 (UTC)Reply[reply]