Topic on Extension talk:PageImages

70.160.223.43 (talkcontribs)

I'm running the following API call: /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower to return a list of articles in the "Flower" category.

With the information in Extension:PageImages#API, since this is using the query action, I can get a list of pageimage information by adding "prop=pageimages" to the url to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower&prop=pageimages

I was expecting the pageimages for each of the pages but the results didn't change.

Since I had an existing "cmprop" parameter, I also tried adding it there to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix|pageimages&cmnamespace=0&cmtitle=Category:Flower but that didn't change anything either.

Am I able to change the url to get the pageimage information for all the pages in the category?

Ciencia Al Poder (talkcontribs)

You need to use categorymembers as a generator, instead of list, because otherwise you are be requesting the pageimage information from the category instead of the members

70.160.223.43 (talkcontribs)

Thanks, that worked perfectly!