In {T400823} we decided to fetch images from other Wikipedias and Wikidata via the [image suggestions data gateway](https://www.mediawiki.org/wiki/Data_Gateway#Image_Suggestions).
This task aims at scaling up the [proof of concept](https://gerrit.wikimedia.org/r/c/1176445).
NOTE: **article-level** image suggestions serve Wikipedia articles that are considered to be **[unillustrated](https://www.mediawiki.org/wiki/Structured_Data_Across_Wikimedia/Image_Suggestions/Data_Pipeline#Find_suggestions_for_Wikipedia_articles)**, while **section-level** ones don't have this constraint.
NOTE: the API endpoint can run on a local MW Docker environment via the `host.docker.internal` host and an SSH tunnel to a debug box: `ssh -t -N mwdebug1002.eqiad.wmnet -L 6030:mwdebug1002.eqiad.wmnet:6030`. **PatchDemo and production deployments need verification.**
==Acceptance criteria
[] Start with a check of the outputs of both APIs for validation. Compare results and decide on approach.
[] Based on approach selected, update AC if necessary and proceed with building.
______________
[] Check out the proof-of-concept patch
[] Fetch suggestions coming from other Wikipedias and Wikidata only: `kind >` `istype-lead-image`, `istype-section-alignment`, `istype-wikidata-image` from the API response's JSON
[] Move suggestion explanations logic from the [front end](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ReaderExperiments/+/1176445/7/resources/ext.readerExperiments.imageBrowsing/imageSuggestions.js#53) to the [API endpoint](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ReaderExperiments/+/1176445/7/src/ApiImageSuggestions.php)
[] Adapt explanations' text to the [design](https://phabricator.wikimedia.org/T402269#11129165)
[] Check if any additional [ApiBase](https://github.com/wikimedia/mediawiki/blob/master/includes/api/ApiBase.php) methods require implementation, see also [docs](https://www.mediawiki.org/wiki/API:Extensions)
[] Switch to the `localhost:6030` service listener as per [TODO](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ReaderExperiments/+/1176445/7/src/ApiImageSuggestions.php#22)
[] After merging, check if it works in PatchDemo, i.e., the above service listener is reachable from there
[] Keep the front end for use in {T402966}