Send api request in socket.io

Hi all,
Am trying to trigger a API Get method in socket.io with frappe.realtime.on is it possible?
Or suggest the way to acheive it?

Thanks