Hi,
The simplest way to get the recently viewed products from HikaShop is to enable the recently viewed products module (it's a module instance of HikaShop content module which is preinstalled with HikaShop to display that).
The issue with that in your case is that modules are supposed to be displayed on a template position and thus you have all the other modules and template around it.
Fortunately, Joomla has the tmpl=component parameter trick to be able to load a page with only the main content on it, without the modules and the template around.
Then, you just have to have that module displayed as main content. For example, with the load position content tag in a Joomla article, or with such extension:
extensions.joomla.org/extension/m2c-module-to-component/
That way, you can have a URL you can call to get the HTML of the recently viewed products module, and you can use that URL in an AJAX request in your javascript.
That's the simplest and doesn't need any coding.