In order to make T246803: Implement new way of abstraction to call remote wbsearchentities API possible, we'll need some "service" / http client that can be used to communicate with the remote API.
The first version should be a flexible service without defined ways of communicating besides giving some API parameters. It should return response interface PSR-7.
This could end up looking similar to https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/576285/
Although as noted in the description above the parameter of the function might make more sense to be the api parameters in the initial version (perhaps as an array)