Expose emulator data

Im tryna write a shiny bot, and Image recognition insist efferent, a better approach would be to reach emulator data for the pokemon and calculate if its shiny, I saw something that could open that data in websockets -_>https://github.com/citra-emu/citra/blob/master/dist/scripting/citra.py , but I dont know how to use it, does anyone know any alternative way, or on how to use the method in the link?