It is possible to use curl to query the LXD unix.socket directly:
curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .
Example output:
{
"type": "sync",
"status": "Success",
"status_code": 200,
"operation": "",
"error_code": 0,
"error": "",
"metadata": [
"/1.0/containers/base",
"/1.0/containers/jay-test-99",
"/1.0/containers/jays-awesome-container-2"
]
}
https://medium.com/@awinashgoswami/lxd-rest-api-b8eb4c72e001