Translations:API:Search and discovery/22/en

If your eventual goal is code running on a wiki, e.g. as a Gadget, then you should use the higher-level  function provided by the 'mediawiki.api' ResourceLoader module.