We already have a prefetching service ApiEntityLookup it is only used in a prefetching term lookup currently.
We removed some old prefetching which could have some parts used as an example (such as finding a list of referenced entities) https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/604121/8/repo/includes/ParserOutput/FullEntityParserOutputGenerator.php#b197
When one of these pages is rendered (ParserOutputGenerator)
As few API calls as possible should be performed
By using the ApiEntityLookup to pre fetch and batch the entity lookups