import urllib.request, json r = urllib.request.urlopen("http://localhost:8899/api/portfolio") d = json.loads(r.read()) for h in d.get('holdings', []): if h['code'] in ('01888', '00700', '000657'): print(f"{h['code']} {h['name']}: price={h['price']} curr={h.get('currency')}")