after you access the node and get the nodeid you can execute this rest call:
https://<your-appd-controller>/controller/rest/applications/<nodeid>/nodes
In the output you get a description of the nodes and there is a field
<machineAgentPresent>...
yes, take a look at this link.
https://docs.appdynamics.com/display/PRO45/AppDynamics+APIs
I use Postman with Basic Auth (my login details) to get the info, but you can build a Python or Java client to do it also.