Task
- Fill out samples on GitHub wiki
- Test samples with Method A and Method B suggested on StackExchange thread
Method A: MediaWiki API for Commons with search query for pages of type "Category" (srnamespace=14), maximum 10 results (srlimit=10):
Method B: MediaWiki API for Commons with opensearch for maximum 10 results (limit=10):
(I modified this to https://commons.wikimedia.org/w/api.php?action=opensearch&format=jsonfm&limit=10&suggest=1&search=Category:apartment%20building , just minor output change to read the results more easily)
- Look for other possible methods
Results
I've completed the tests for Method A and B - Method A seems to vastly outperform Method B, and produces some decent category suggestions.
I've also searched for other possible APIs but have not found anything useful so far.
Conclusion
We have discussed this and have decided that we will go with Method A.