Python script to perform queries using nexus rest api