I want to fetch the Wikibase identifier (an integer with a M
prefix) of all files resulting from a Wikimedia Commons search.
Example: Searching for aburasoba azabujuban
, the query should return (potentially among other results) M80618155
, because it is the Wikibase identifier of Tantanmen.jpeg whose caption contains these two keywords.
Problem: The API call in the documentation does not return the Wikibase identifier, instead it only returns the title/URL/etc of each file.
Question: How can I modify this API call to retrieve the Wikibase identifiers? If possible without making another request for each result.
(Thanks to Multichill)
Your query returns the page id, prepend M to that and you have it: