import requests import json resp = requests.get("http://localhost:8000/api/lab/kpi") print(json.dumps(resp.json(), indent=2))