almalino there is no special command line API.
The REST API is probably what you need here.
Unfortunately we don't have a good documentation for the REST API yet. You can inspect which requests the single page app makes as it's the same API.
The REST API follows json:api syntax and there should be a discussion somewhere on the forum that explains how to make an API key to use from a script but I'm not sure which one it was.