Structure plugin provides REST API, which is primarily used by the structure widget. The same API can be used to access the hierarchical data remotely from an automation script or another user agent application.

See details in the REST API Reference.