How to read JSON from URL requests in python
In this exercise, you will learn how to read JSON from URL requests using Python.
JSON (JavaScript Object Notation) is a lightweight, open standard, data-interchange format. It is easy to read and write for humans. It is used primarily to transmit data between a web application and a server. Today, it is more popular than XML.
In this exercise, we have imported two modules - JSON and urllib.request. The JSON module is an in-built package of Python and is used to work with JSON data. It offers a function json.loads to parse the JSON string.
When we run the above code, the output will look like this -

need an explanation for this answer? contact us directly to get an explanation for this answer