Page MenuHomePhabricator

API action=query prop=categories does not list categories for many file results
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

We see very few hidden categories - only those of a few very old files.

What should have happened instead?:

The full list of hidden categories should be shown for each entry. Here is the full list for a random one:
https://commons.wikimedia.org/w/api.php?action=query&prop=categories&titles=File:Bird_oomph_.ogg&clshow=hidden

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Removing API Platform (see its description), this seems to be about the MediaWiki-Action-API instead

Aklapper renamed this task from API action=query prop=categories data loss in generator to API action=query prop=categories does not list categories for many file results.Mar 8 2023, 2:35 PM

The api result contains a continue parameter to get more results. It could be better to provide a limit also for the prop=categories, like cllimit=500 to avoid use of default cllimit=10

I see. I forgot a limit, and I now need to chop it up into more runs.
$ w3m -dump 'https://commons.wikimedia.org/w/api.php?action=query&generator=allimages&gaiuser=Jidanni&gaisort=timestamp&gailimit=500&prop=categories&clshow=hidden&cllimit=500' | grep -c Category
500

I'll close this now, but I sure hope some tutorial has a "need to raise inner limit example" somewhere.