Is there currently an API to connect via an external app running on the same machine or over a network?

I’m looking to see if it is possible to set an external application as a ‘controller’ and data source. Is there an API or comm port that I could use to send function calls or data to, and also to trigger animations?

If so could it be controlled be an external machine over a dedicated network?