json.load loads from a file-like object. You either want to use json.loads:

json.loads(data)

Or just use json.load on the request, which is a file-like object:

json.load(request)

Also, if you use the requests library, you can just do:

import requests

json = requests.get(url).json()
Answer from Blender on Stack Overflow
๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-loads-in-python
json.loads() in Python - GeeksforGeeks
Example: This example shows how a JSON string is converted into a Python dictionary using json.loads(). ... Explanation: json.loads(s) parses the JSON string s and converts it into a Python dict.
Published ย  January 13, 2026
Discussions

Convert string to JSON in Python? - Stack Overflow
I'm trying to convert a string, generated from an http request with urllib3. Traceback (most recent call last): File " ", line 1, in data = json.load(data) ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How can I parse (read) and use JSON in Python? - Stack Overflow
Similarly, \\\\\\\\\\\" (five pairs ... as Python can use single quotes for the string; but the backslashes still do). Aside from the strict option, the keyword options available for json.load and json.loads should be callbacks. The parser will call them, passing in portions of the data, and use whatever is returned to create the overall result. The "parse" hooks are fairly self-explanatory. For example, we can specify ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Convert JSON string to dict using Python - Stack Overflow
How can I transform this string into a structure and then call json["title"] to obtain "example glossary"? ... Sign up to request clarification or add additional context in comments. ... @ShivamAgrawal: The difference is that .load() parses a file object; .loads() parses a string / unicode object. More on stackoverflow.com
๐ŸŒ stackoverflow.com
easy way to extract json part of a string?
The correct move here is to edit the Powershell script to remove that output. That being said, consider that if you find the beginning of the JSON object, you can then pass the remaining string to json.loads. It will then raise a JSONDecodeError , which contains the position of where the error occured. So you slice the string one more time and try again. Result: import json def parse_json_garbage(s): s = s[next(idx for idx, c in enumerate(s) if c in "{["):] try: return json.loads(s) except json.JSONDecodeError as e: return json.loads(s[:e.pos]) In the REPL: >>> parse_json_garbage(""" ... this is a bunch of crap, ignore this please ... More crap ... ayylmao ... { ... "foo" : "bar", ... "baz" : "quux" ... } ... More crap goes here! ... """) {'foo': 'bar', 'baz': 'quux'} More on reddit.com
๐ŸŒ r/learnpython
12
2
January 12, 2022
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.3 documentation
4 weeks ago - 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.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-json-how-to-convert-a-string-to-json
Python JSON โ€“ How to Convert a String to JSON
November 9, 2021 - import json employees_string = ''' { "employees" : [ { "first_name": "Michael", "last_name": "Rodgers", "department": "Marketing" }, { "first_name": "Michelle", "last_name": "Williams", "department": "Engineering" } ] } ''' data = json.loads(e...
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - When you converted dog_registry to dog_json using json.dumps(), the integer key 1 became the string "1". When you used json.loads(), there was no way for Python to know that the string key should be an integer again. Thatโ€™s why your dictionary key remained a string after deserialization. Youโ€™ll investigate a similar behavior by doing another conversion roundtrip with other Python data types! To explore how different data types behave in a roundtrip from Python to JSON and back, take a portion of the dog_data dictionary from a former section.
Find elsewhere
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - ... 1import json 2json_string ='{"numbers": [1, 2, 3], "car": {"model": "Model X", "year": 2022}}' 3json_data = json.loads(json_string) 4# Accessing JSON array elements using array indexing 5print(json_data['numbers'][0]) # Output: 1 6# Accessing ...
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ python โ€บ g4nr6w3u โ€บ python-parse-json-example
How to parse a JSON with Python?
To parse a JSON file, use the json.load() paired method (without the "s"). In this Python Parse JSON example, we convert a JSON data string into a Python object.
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Load, Parse, Serialize JSON Files and Strings in Python | note.nkmk.me
August 6, 2023 - A mismatch in case usage will result in an error, for example, using True instead of true. s = '{"A": True}' # d = json.loads(s) # JSONDecodeError: Expecting value: line 1 column 7 (char 6) ... Note that, starting from Python 3.6, you can also ...
๐ŸŒ
Apify
blog.apify.com โ€บ how-to-parse-json-with-python
How to parse JSON with Python
March 11, 2025 - In this example, name, age, and city are the keys, and "John Doe", 30, and "New York" are the corresponding values. To extract JSON from a string in Python, you can use the json.loads() method.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
... import json with open('data.json', 'r') as file: data = json.load(file) print(json.dumps(data, indent=4)) ... In this example, we are reading data from the "data.json" file, and the output retains the same structured format as the original ...
Published ย  September 15, 2025
๐ŸŒ
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 - I mean, when you dump JSON into a file or string, we can pass OrderedDict to it. But, when we want to maintain order, we load JSON data back to an OrderedDict so we can keep the order of the keys in the file. As we already discussed in the article, a object_pairs_hook parameter of a json.load() method is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. Letโ€™ see the example now. import json from collections import OrderedDict print("Ordering keys") OrderedData = json.loads('{"John":1, "Emma": 2, "Ault": 3, "Brian": 4}', object_pairs_hook=OrderedDict) print("Type: ", type((OrderedData))) print(OrderedData)Code language: Python (python)
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-ways-to-convert-string-to-json-object
Convert String to JSON Object - Python - GeeksforGeeks
For example, a JSON string like {"name": "John", "age": 30, "city": "New York"} can be converted into a Python dictionary, {'name': 'John', 'age': 30, 'city': 'New York'}, which allows you to access values by their keys.
Published ย  July 11, 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} ... Purpose: ...
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ convert json object to string in python
Convert JSON Object to String in Python - Spark By {Examples}
May 21, 2024 - We are often required to convert ... for example, json.dumps() is utilized to convert JSON to string and also we can directly use the str() and repr() methods that will convert json object to a string....
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ json
Python JSON: Read, Write, Parse JSON (With Examples)
To work with JSON (string, or file containing JSON object), you can use Python's json module. You need to import the module before you can use it. ... The json module makes it easy to parse JSON strings and files containing JSON object. You can parse a JSON string using json.loads() method.
๐ŸŒ
FavTutor
favtutor.com โ€บ blogs โ€บ read-write-and-parse-json-in-python
Read, Write and Parse JSON File in Python
October 14, 2023 - This method takes a JSON string as input and returns the corresponding Python number. Here is an example: import json # JSON string json_string = '42' # Convert JSON to number number = json.loads(json_string) # Print the number print(number)