import requests import json with open('./sample_payload.json', 'r') as file: input = json.load(file) def main(input): # input = input['input'] for items in input['payload']['data']['included']: if items['type'] == 'quizzes': try: if items['name'] == 'Deutsch Einstufungstest': print('quiz!') except TypeError as h: print(h) elif items['type'] == 'people': print('people') if __name__ == "__main__": main(input)