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 › gloss_python_convert_into_JSON.asp
Python Convert From Python to JSON
Remove List Duplicates Reverse ... ... If you have a Python object, you can convert it into a JSON string by using the json.dumps() method....
🌐
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 - This comes built-in to Python and is part of the standard library. So, say you have a file named demo.py. At the top you would add the following line: ... #include json library import json #json string data employee_string = '{"first_name": "Michael", "last_name": "Rodgers", "department": "Marketing"}' #check data type with type() method print(type(employee_string)) #output #<class 'str'>
🌐
Dadroit
dadroit.com › string-to-json
Online String to JSON Converter
To convert String to JSON, visit the tool address, input your String data —or load your String file— and the tool will display the corresponding JSON output in real time.
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... JSON is a syntax for storing and exchanging data. JSON is text, written with JavaScript object notation. Python has a built-in package called json, which can be used to work with JSON data.
🌐
iProyal
iproyal.com › blog › python-string-to-json
How to Convert a Python String to JSON (Beginner’s Guide)
August 18, 2025 - Use `json.dumps()` to serialize a Python object into a JSON string.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-ways-to-convert-string-to-json-object
Convert String to JSON Object - Python - GeeksforGeeks
Let's explore different methods to do this efficiently. json.loads() method is the most commonly used function for parsing a JSON string and converting it into a Python dictionary.
Published   July 11, 2025
🌐
Code Beautify
codebeautify.org › string-to-json-online
String to JSON Online to convert JSON Text to JSON Tree.
This online json string parser helps a developer who works to JSON String data as easy to parse and understand. Know more about JSON. How to Create JSON File? JSON Full Form · What is JSON? JSON Example with JSON Array · Pretty Print JSON using Python · Read JSON File Using Python ·
Find elsewhere
🌐
Python.org
discuss.python.org › python help
Convert evaled string to JSON - Python Help - Discussions on Python.org
September 28, 2022 - I am getting a (suppossed to be) JSON string like this : (sJSON) { 'ARN': 'arn:aws:xxx:xxx:secret:xxx', 'Name': 'xxx/local', 'VersionId': 'xxx-xxx-xxx-xxx-xxx', 'SecretString': 'E:\\path\\to\\folder\\xxx.json', 'VersionStages': ['AWSCURRENT'], 'CreatedDate': datetime.datetime(2022, 9, 28, 8, 25, 35, 329448, tzinfo = tzlocal()), 'ResponseMetadata': { 'RequestId': 'xxx', 'HTTPStatusCode': 200, 'HTTPHeaders': { 'content-type': 'application/x-amz-json-1.1', 'content-length': '306...
Top answer
1 of 2
201

json.dumps() is much more than just making a string out of a Python object, it would always produce a valid JSON string (assuming everything inside the object is serializable) following the Type Conversion Table.

For instance, if one of the values is None, the str() would produce an invalid JSON which cannot be loaded:

>>> data = {'jsonKey': None}
>>> str(data)
"{'jsonKey': None}"
>>> json.loads(str(data))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 1 column 2 (char 1)

But the dumps() would convert None into null making a valid JSON string that can be loaded:

>>> import json
>>> data = {'jsonKey': None}
>>> json.dumps(data)
'{"jsonKey": null}'
>>> json.loads(json.dumps(data))
{u'jsonKey': None}
2 of 2
2

There are other differences. For instance, {'time': datetime.now()} cannot be serialized to JSON, but can be converted to string. You should use one of these tools depending on the purpose (i.e. will the result later be decoded).

🌐
Scaler
scaler.com › home › topics › string to json python
Convert String to JSON in Python - Scaler Topics
December 4, 2023 - This function accepts a Python object and produces a JSON string as its output. Decoding (deserializing) JSON: To change a JSON string into a Python object, the json.loads() function is used.
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.3 documentation
For the most compact JSON, specify (',', ':') to eliminate whitespace. default (callable | None) – A function that is called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError. If None (the default), TypeError is raised. sort_keys (bool) – If True, dictionaries will be outputted sorted by key. Default False. Changed in version 3.2: Allow strings for indent in addition to integers.
🌐
LearnPython.com
learnpython.com › blog › json-in-python
How to Convert a String to JSON in Python | LearnPython.com
The dumps() method converts a Python object to a JSON formatted string. We can also create a JSON file from data stored in a Python dictionary.
🌐
ReqBin
reqbin.com › code › python › g4nr6w3u › python-parse-json-example
How to parse a JSON with Python?
Using the JSON Encoder and Decoder module, you can serialize (dump) Python objects to JSON strings or deserialize (parse) JSON strings to Python objects. The JSON encoder can create pretty or compact JSON strings, or convert Python objects directly ...
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › python json – how to convert a string to json
Python JSON – How to Convert a String to JSON: Guide & Examples
January 4, 2026 - The json.loads function in Python facilitates the decoding or deserialization of a JSON string back to its Python object form. Indeed, using the json.dumps method, Python lists can be serialized directly into JSON format. Numerous online platforms cater to string to JSON online conversions, ...
🌐
W3Resource
w3resource.com › JSON › snippets › convert-string-to-json.php
Convert String to JSON in Python and JavaScript.
... JSON data stored in files (like .json) is read as strings and needs to be converted into JSON objects for further usage. ... Always validate your JSON string before parsing. Use online tools like JSONLint.
🌐
GitHub
gist.github.com › craigsdennis › 0f00869fe2e2f2da9d6287984c62b2af
Convert Python String to JSON · GitHub
Convert Python String to JSON · Raw · pythonDictParser.js · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
Analytics Vidhya
analyticsvidhya.com › home › ways to convert string to json object
Ways to Convert String to JSON Object
March 21, 2024 - In such cases, json.loads() remains the preferred choice due to its broader support for handling JSON structures. The eval() function in Python can also be utilized to convert a string to a JSON object.