I want to get pages from Wikimedia Commons and it seems, that I have still not understand the usage of the Wikimedia API.
I use the following query
https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&format=json&iiprop=url|size|mime|mediatype|extmetadata&iiurlwidth=150&generator=search&gsrsearch=transformation&gsrnamespace=6&gsrlimit=9&gsroffset=0&gsrinfo=totalhits
Which works great, except that I don't get the grsinfo / generator metadata. But I need the total amount of results (totalhits).
Any suggestions?
Per the docs,
If you need the hit count, you'll have to do a normal search API query, manually generate a list of pages from it and query them in a second API request.