import urllib.request import json try: with urllib.request.urlopen("http://127.0.0.1:9223/json/version") as resp: data = json.loads(resp.read().decode()) print("Version:", data) except Exception as e: print("Error:", e)