is it possible to host code on online place, running and send results to WordPress, so can read and use as well on Wordpress? Thanks
Yes, it is possible. You can create an API project with API functions and Wordpress can send requests remotely to the API you are to create.