I am using the following wikimedia API to list all pages with a certain category: https://www.mediawiki.org/wiki/API:Categorymembers
E.g. https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics
This gives me a list of pages with title and id, but I would also like to see all categories for each page. However it seems that there is no cmprop for that.
cmprop: Which properties to get. (Default: ids|title)
ids: Page ID
title: Page title
sortkey: The sortkey used for sorting in the category (hexadecimal string)
sortkeyprefix: The sortkey prefix used for sorting in the category (human-readable part of the sortkey) 1.17+
type: Type that the page has been categorised as (page, subcat or file) 1.17+
timestamp: Time and date the article was added to the category
I have considered to query each page and use prop=categories to get the categories for each page, but that would mean a very large number of queries. Is there any better way of doing this?