It’s possible to export stats to a JSON file.
$ glances --export json --export-json-file json /tmp/glances.json