import json with open("index.json") as fin: data = json.load(fin) projects, shows = 0, 0 for item in data["@graph"]: if item['type'] == "project": projects += 1 elif item['type'] == "gradshow": shows +=1 else: raise Exception("unknown type") print (f"{shows} shows, {projects} projects")