Copyimport json

array = '{"fruits": ["apple", "banana", "orange"]}'
data  = json.loads(array)
print(data['fruits']) 
# the print displays:
# ['apple', 'banana', 'orange']

You had everything you needed. data will be a dict, and data['fruits'] will be a list

Answer from jdi on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-loads-in-python
json.loads() in Python - GeeksforGeeks
Example 2: This example shows how a JSON array is converted into a Python list. ... Explanation: json.loads(s) converts the JSON array into a Python list.
Published ย  January 13, 2026
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-json-to-list
Python Json To List - GeeksforGeeks
April 18, 2026 - In this example, the below code utilizes the json.loads() method to convert a JSON-formatted string [1,2,3,4] into a Python list named arr.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.5 documentation
When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. That is, loads(dumps(x)) != x if x has non-string keys.
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-json-to-list
Python JSON to List
Python JSON to List - To convert a JSON String to Python List, use json.loads() function. loads() function takes JSON Array string as argument and returns a Python List. In this tutorial, we have examples to load json array string to python list.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_json.asp
Python JSON
Python has a built-in package called json, which can be used to work with JSON data. ... If you have a JSON string, you can parse it by using the json.loads() method.
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - Once you convert the JSON data back to Python, then an array deserializes into the Python list data type. Generally, being cautious about data type conversions should be the concern of the Python program that writes the JSON. With the knowledge you have about JSON files, you can always anticipate which Python data types youโ€™ll end up with as long as the JSON file is valid. If you use json.load(), then the content of the file you load must contain valid JSON syntax.
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ json โ€บ python json parsing using json.load() and loads()
Python JSON Parsing using json.load() and loads()
May 14, 2021 - Understand use of json.loads() and load() to parse JSON. Read JSON encoded data from a file or string and convert it into Python dict
Find elsewhere
๐ŸŒ
CodeSpeedy
codespeedy.com โ€บ home โ€บ convert json to list in python
Convert JSON to list in Python - CodeSpeedy
July 9, 2019 - We know that, JSON array is Pythonโ€™s list. json.dumps(obj)โ€“>Convert Python object to JSON string. json.loads(โ€œjsonโ€) โ€“> Convert JSON string into Python object. Hence, by using json.loads() function, one can simply convert JSON data ...
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ python json.loads() method with examples
Python json.loads() Method with Examples - Spark By {Examples}
May 31, 2024 - The json loads() is a method from the json Python module that is used to parse a JSON (JavaScript Object Notation) string and convert it into a Python
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-load-in-python
json.load() in Python - GeeksforGeeks
April 3, 2026 - Return Type: Returns a Python object (dict, list, etc.) representing the JSON data. Example 1: This example reads the company name and year from the JSON file. It shows how to access a key-value pairs. ... Explanation: d['company'] and d['year'] access top-level keys from the dictionary returned by json.load(f).
๐ŸŒ
PythonHow
pythonhow.com โ€บ how โ€บ load-json-data-in-python
Here is how to load JSON data in Python
import json # Load JSON data from a file with open('employees.json', 'r') as file: employees = json.load(file) # Access and print employee details for employee in employees: print(f"Name: {employee['name']}, Age: {employee['age']}, Department: {employee['department']}, Title: {employee['title']}") ... This simple script reads employee data from a JSON file and prints each employee's details. Using Python's json module makes it straightforward to parse and work with JSON data.
Top answer
1 of 2
47

In your for loop statement, Each item in json_array is a dictionary and the dictionary does not have a key store_details. So I modified the program a little bit

import json

input_file = open ('stores-small.json')
json_array = json.load(input_file)
store_list = []

for item in json_array:
    store_details = {"name":None, "city":None}
    store_details['name'] = item['name']
    store_details['city'] = item['city']
    store_list.append(store_details)

print(store_list)
2 of 2
1

If you arrived at this question simply looking for a way to read a json file into memory, then use the built-in json module.

with open(file_path, 'r') as f:
    data = json.load(f)

If you have a json string in memory that needs to be parsed, use json.loads() instead:

data = json.loads(my_json_string)

Either way, now data is converted into a Python data structure (list/dictionary) that may be (deeply) nested and you'll need Python methods to manipulate it.


If you arrived here looking for ways to get values under several keys as in the OP, then the question is about looping over a Python data structure. For a not-so-deeply-nested data structure, the most readable (and possibly the fastest) way is a list / dict comprehension. For example, for the requirement in the OP, a list comprehension does the job.

store_list = [{'name': item['name'], 'city': item['city']} for item in json_array]
# [{'name': 'Mall of America', 'city': 'Bloomington'}, {'name': 'Tempe Marketplace', 'city': 'Tempe'}]

Other types of common data manipulation:

  1. For a nested list where each sub-list is a list of items in the json_array.

    store_list = [[item['name'], item['city']] for item in json_array]
    # [['Mall of America', 'Bloomington'], ['Tempe Marketplace', 'Tempe']]
    
  2. For a dictionary of lists where each key-value pair is a category-values in the json_array.

    store_data = {'name': [], 'city': []}
    for item in json_array:
        store_data['name'].append(item['name'])
        store_data['city'].append(item['city'])
    # {'name': ['Mall of America', 'Tempe Marketplace'], 'city': ['Bloomington', 'Tempe']}
    
  3. For a "transposed" nested list where each sub-list is a "category" in json_array.

    store_list = list(store_data.values())
    # [['Mall of America', 'Tempe Marketplace'], ['Bloomington', 'Tempe']]
    
๐ŸŒ
Medium
medium.com โ€บ @imrohitkushwaha2001 โ€บ understanding-json-loads-in-python-a-simple-guide-0b0dedd9e824
Understanding json.loads() in Python: A Simple Guide | by Rohit Kushwaha | Medium
July 8, 2025 - import json python_object = json.loads(json_string) json_string: A string in JSON format (must use double quotes for keys and string values) python_object: A Python dictionary, list, or another structure depending on the JSON content
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
If you're interested in mastering ... Full Python Course for Beginners might be a great next step. The course emphasizes hands-on projects and practical programming skills, helping you apply concepts like these in real-world scenarios. In the below code, firstly we import the JSON module, open the file using the file handling open() function, and then store the data into the variable 'data' using the json.load() ...
Published ย  April 2, 2025
๐ŸŒ
Medium
medium.com โ€บ @gadallah.hatem โ€บ the-difference-between-json-loads-and-json-load-2dbd30065f26
The difference between json.loads() and json.load() in Python | by Hatem A. Gad | Medium
December 15, 2024 - import json # JSON string json_string = '{"name": "Alice", "age": 30, "is_member": true}' # Convert JSON string to Python dictionary data = json.loads(json_string) print(data) # Output: {'name': 'Alice', 'age': 30, 'is_member': True}