import 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
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
import json # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["age"]) Try it Yourself »
🌐
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 module that is used to parse a JSON (JavaScript Object Notation) string and convert it into a Python object. The method takes a JSON string as an input param and returns a Python object, usually a ...
🌐
Python
docs.python.org › 3 › library › json.html
json — JSON encoder and decoder
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-json-to-list
Python Json To List - GeeksforGeeks
July 23, 2025 - In this example, The code parses a JSON string containing a list of dictionaries using `json.loads()`. It then extracts the keys from the first dictionary in the list and prints the type of the original string, the extracted keys, and the type of the resulting list, respectively.
🌐
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   June 16, 2020
🌐
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.
Find elsewhere
🌐
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
🌐
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.
🌐
DataCamp
datacamp.com › tutorial › json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - While Python is capable of storing intricate data structures such as sets and dictionaries, JSON is limited to handling strings, numbers, booleans, arrays, and objects. Let’s look at some of the differences: To convert a Python list to JSON format, you can use the json.dumps() method from ...
🌐
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 - Listen · Share · Press enter ... where they are commonly used · Stands for: Load String · Purpose: Converts a JSON-encoded string into a Python object (e.g., dictionary or list)....
🌐
Databricks Community
community.databricks.com › t5 › data-engineering › how-to-read-json-files-embedded-in-a-list-of-lists › td-p › 22084
Solved: How to read JSON files embedded in a list of lists... - Databricks Community - 22084
September 13, 2024 - You can see the head of the file, JSON inside a list of lists. Any idea how to read this file? ... import json data=[] with open(path_to_json_file, 'r') as f: data.extend(json.load(f)) df = spark.createDataFrame(data[0], schema=schema)
Top answer
1 of 6
31

I did json.loads(json.loads(string)) and was able to get the dictionary. You can check it out. The first time it doesn't just return the same string, but processes it (e.g. removes \\ characters).

2 of 6
24

Ok first you should print your object so that you can read it:

>>> from pprint import pprint
>>> output = [{'in_reply_to_status_id_str': None, 'in_reply_to_screen_name': None, 'retweeted':     False, 'in_reply_to_status_id': None, 'contributors': None, 'favorite_count': 0, 'in_reply_to_user_id': None, 'coordinates': None, 'source': '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>', 'geo': None, 'retweet_count': 0, 'text': 'Tweeting a url \nhttp://t.co/QDVYv6bV90', 'created_at': 'Mon Sep 01 19:36:25 +0000 2014', 'entities': {'symbols': [], 'user_mentions': [], 'urls': [{'expanded_url': 'http://www.isthereanappthat.com', 'display_url': 'isthereanappthat.com', 'url': 'http://t.co/QDVYv6bV90', 'indices': [16, 38]}], 'hashtags': []}, 'id_str': '506526005943865344', 'in_reply_to_user_id_str': None, 'truncated': False, 'favorited': False, 'lang': 'en', 'possibly_sensitive': False, 'id': 506526005943865344, 'user': {'profile_text_color': '333333', 'time_zone': None, 'entities': {'description': {'urls': []}}, 'url': None, 'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png', 'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png', 'protected': False, 'default_profile_image': True, 'utc_offset': None, 'default_profile': True, 'screen_name': 'KickzWatch', 'follow_request_sent': False, 'following': False, 'profile_background_color': 'C0DEED', 'notifications': False, 'description': '', 'profile_sidebar_border_color': 'C0DEED', 'geo_enabled': False, 'verified': False, 'friends_count': 40, 'created_at': 'Mon Sep 01 16:29:18 +0000 2014', 'is_translator': False, 'profile_sidebar_fill_color': 'DDEEF6', 'statuses_count': 4, 'location': '', 'id_str': '2784389341', 'followers_count': 4, 'favourites_count': 0, 'contributors_enabled': False, 'is_translation_enabled': False, 'lang': 'en', 'profile_image_url': 'http://abs.twimg.com/sticky/default_profile_images/default_profile_6_normal.png', 'profile_image_url_https': 'https://abs.twimg.com/sticky/default_profile_images/default_profile_6_normal.png', 'id': 2784389341, 'profile_use_background_image': True, 'listed_count': 0, 'profile_background_tile': False, 'name': 'Maktub Destiny', 'profile_link_color': '0084B4'}, 'place': None}]
>>> pprint(output)
[{'contributors': None,
  'coordinates': None,
  'created_at': 'Mon Sep 01 19:36:25 +0000 2014',
  'entities': {'hashtags': [],
               'symbols': [],
               'urls': [{'display_url': 'isthereanappthat.com',
                         'expanded_url': 'http://www.isthereanappthat.com',
                         'indices': [16, 38],
                         'url': 'http://t.co/QDVYv6bV90'}],
               'user_mentions': []},
  'favorite_count': 0,
  'favorited': False,
  'geo': None,
  'id': 506526005943865344,
  'id_str': '506526005943865344',
  'in_reply_to_screen_name': None,
  'in_reply_to_status_id': None,
  'in_reply_to_status_id_str': None,
  'in_reply_to_user_id': None,
  'in_reply_to_user_id_str': None,
  'lang': 'en',
  'place': None,
  'possibly_sensitive': False,
  'retweet_count': 0,
  'retweeted': False,
  'source': '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
  'text': 'Tweeting a url \nhttp://t.co/QDVYv6bV90',
  'truncated': False,
  'user': {'contributors_enabled': False,
           'created_at': 'Mon Sep 01 16:29:18 +0000 2014',
           'default_profile': True,
           'default_profile_image': True,
           'description': '',
           'entities': {'description': {'urls': []}},
           'favourites_count': 0,
           'follow_request_sent': False,
           'followers_count': 4,
           'following': False,
           'friends_count': 40,
           'geo_enabled': False,
           'id': 2784389341,
           'id_str': '2784389341',
           'is_translation_enabled': False,
           'is_translator': False,
           'lang': 'en',
           'listed_count': 0,
           'location': '',
           'name': 'Maktub Destiny',
           'notifications': False,
           'profile_background_color': 'C0DEED',
           'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
           'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
           'profile_background_tile': False,
           'profile_image_url': 'http://abs.twimg.com/sticky/default_profile_images/default_profile_6_normal.png',
           'profile_image_url_https': 'https://abs.twimg.com/sticky/default_profile_images/default_profile_6_normal.png',
           'profile_link_color': '0084B4',
           'profile_sidebar_border_color': 'C0DEED',
           'profile_sidebar_fill_color': 'DDEEF6',
           'profile_text_color': '333333',
           'profile_use_background_image': True,
           'protected': False,
           'screen_name': 'KickzWatch',
           'statuses_count': 4,
           'time_zone': None,
           'url': None,
           'utc_offset': None,
           'verified': False}}]

From looking at this you can see that output is a list which contains a single dict. To access this you need:

>>> first_elem = output[0]

You will also see that the hashtags key in the first_elem is contained in a second level dict under the key entities:

>>> entities = first_elem['entities']
>>> pprint(entities)
{'hashtags': [],
 'symbols': [],
 'urls': [{'display_url': 'isthereanappthat.com',
           'expanded_url': 'http://www.isthereanappthat.com',
           'indices': [16, 38],
           'url': 'http://t.co/QDVYv6bV90'}],
 'user_mentions': []}

Now you are able to access hashtags:

>>> entities['hashtags']
[]

Which just happens to be the empty list.

To convert to JSON, note the comment:

>>> import json
>>> # Make sure output is the list object not a string representing the object
>>> json_string = json.dumps(output)
>>> jason = json.loads(output)
>>> jason[0]['entities']['hashtags']
[]

I think your problem is that you made output a string before you json.dumps it, meaning that json.loads will return a string, not a json object.

And @Dan's answer is correct, this is not valid JSON. It is however a valid python dict, and I'm assuming that you got it from Twitter using python then printed it.

🌐
Bogotobogo
bogotobogo.com › python › python-json-dumps-loads-file-read-write.php
Python Tutorial: json.dump(s) & json.load(s) - 2024
import json # dict from a string : json.loads(string) with open("bogo.json","r") as f: a = f.read() s_d = json.loads(a) print(f"type(s_d) = {type(s_d)}, sd = {s_d}") # dict from a file : json.load(file Pointer) f_d = json.load(open("bogo.json","r")) print(f"type(f_d) = {type(f_d)}, fd = {f_d}") # dump dict as a string d_s = json.dumps(s_d) print(f"type(ds_) = {type(d_s)}, ds = {d_s}") # dump dict as a file json.dump(f_d, open("bogo_dumped.json","w"))
🌐
Analytics Vidhya
analyticsvidhya.com › home › python json.loads() and json.dump() methods
Python json.loads() and json.dump() methods - Analytics Vidhya
May 1, 2025 - The json.loads() function automatically ... strings, JSON numbers are converted to Python integers or floats, and JSON arrays are converted to Python lists....
🌐
Programiz
programiz.com › python-programming › json
Python JSON: Read, Write, Parse JSON (With Examples)
import json person = '{"name": "Bob", "languages": ["English", "French"]}' person_dict = json.loads(person) # Output: {'name': 'Bob', 'languages': ['English', 'French']} print( person_dict) # Output: ['English', 'French'] print(person_dict['languages'])
🌐
Note.nkmk.me
note.nkmk.me › home › python
Load, Parse, Serialize JSON Files and Strings in Python | note.nkmk.me
August 6, 2023 - You can use json.load() to load JSON files into Python objects, such as dictionaries.
🌐
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