import json import pprint with open('1scooter.json') as file: data = json.load(file) print(json.dumps(data['data']['attributes']['lat'], indent=4, sort_keys=True))