Get data from the URL and then call json.loads e.g.

Python3 example:

import urllib.request, json 
with urllib.request.urlopen("http://maps.googleapis.com/maps/api/geocode/json?address=google") as url:
    data = json.loads(url.read().decode())
    print(data)

Python2 example:

import urllib, json
url = "http://maps.googleapis.com/maps/api/geocode/json?address=google"
response = urllib.urlopen(url)
data = json.loads(response.read())
print data

The output would result in something like this:

{
"results" : [
    {
    "address_components" : [
        {
            "long_name" : "Charleston and Huff",
            "short_name" : "Charleston and Huff",
            "types" : [ "establishment", "point_of_interest" ]
        },
        {
            "long_name" : "Mountain View",
            "short_name" : "Mountain View",
            "types" : [ "locality", "political" ]
        },
        {
...
Answer from Anurag Uniyal on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-read-a-json-response-from-a-link-in-python
How to read a JSON response from a link in Python? - GeeksforGeeks
July 23, 2025 - This library helps to open the URL and read the JSON response from the web. To use this library in python and fetch JSON response we have to import the json and urllib in our code, The json.loads() method returns JSON object. Below is the process by which we can read the JSON response from a link ...
🌐
Real Python
realpython.com › python-json
Working With JSON Data in Python – Real Python
August 20, 2025 - If you followed along with the tutorial, then you’ve got a hello_frieda.json file that doesn’t contain newlines or indentation. Alternatively, you can download hello_frieda.json in the materials by clicking the link below: Free Bonus: Click here to download the free sample code that shows you how to work with JSON data in Python.
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.3 documentation
Source code: Lib/json/__init__.py JSON (JavaScript Object Notation), specified by RFC 7159(which obsoletes RFC 4627) and by ECMA-404, is a lightweight data interchange format inspired by JavaScript...
🌐
Stack Abuse
stackabuse.com › how-to-get-json-from-a-url-in-python
How to Get JSON from a URL in Python
February 14, 2025 - We used the get() method to fetch JSON data from the URL https://jsonplaceholder.typicode.com/posts, we extracted the JSON data using the json() method, and printed it to the console. And that's pretty much it! You will get the JSON response stored as a Python list, with each post represented ...
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-the-json-module-in-python
How to Use the JSON Module in Python – A Beginner's Guide
June 5, 2023 - As you can see in the example, executing the json.tool module with the input file path formats the JSON data and displays the formatted output on the console. You can also redirect the formatted output to an output file by specifying the output file name as the second argument: python -m json.tool horoscope_data.json formatted_data.json
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
If you have a Python object, you can convert it into a JSON string by using the json.dumps() method.
🌐
ReqBin
reqbin.com › code › python › rituxo3j › python-requests-json-example
How do I get JSON using the Python Requests?
In this Python GET JSON example, we send a GET request to the ReqBin echo URL and receive JSON data in the response. The custom 'Accept: application/json' header tells the server that the client expects a JSON.
Find elsewhere
🌐
Delft Stack
delftstack.com › home › howto › python › python get json from url
How to Get JSON From URL in Python | Delft Stack
February 2, 2024 - In this tutorial, we will see how to get, parse and access the JSON data using built in modules in Python.
🌐
Finxter
blog.finxter.com › home › learn python blog › how to get json from url in python?
How to Get JSON from URL in Python? - Be on the Right Side of Change
May 20, 2021 - import urllib.request import json # Bitcoin Genesis Block Transactions your_url = 'https://blockchain.info/rawaddr/12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX' with urllib.request.urlopen(your_url) as url: data = json.loads(url.read().decode()) print(data)
🌐
Python Basics
pythonbasics.org › json
Working With JSON Data in Python - Python Tutorial
Interacting with the web is mostly done through APIs (Application Programmable Interface), in JSON format. Related course: Complete Python Programming Course & Exercises
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-json
Python JSON - GeeksforGeeks
December 23, 2025 - This is JSON <class 'str'> Now convert from JSON to Python Converted to Python <class 'dict'> {'id': '09', 'name': 'Nitin', 'department': 'Finance'} Let's see an example where we convert Python objects to JSON objects.
🌐
Medium
medium.com › @AlexanderObregon › how-to-work-with-json-in-python-aef62d28eac4
How to Work with JSON in Python | Medium
November 2, 2024 - Learn how to read, write, and manipulate JSON data using Python's json module, with examples covering APIs, file handling, and data processing.
🌐
ReqBin
reqbin.com › req › python › 5nqtoxbx › get-json-example
Python | How to get JSON from URL?
The server informs the Python client that it has returned JSON with a Content-Type: application/json response header. In this Python JSON from URL example, we make a GET request to the ReqBin echo URL to get the JSON.
🌐
GitHub
gist.github.com › sirleech › 2660189
Python Read JSON from HTTP Request of URL · GitHub
Python Read JSON from HTTP Request of URL · Raw · gistfile1.py · 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. Learn more about bidirectional Unicode characters · Show hidden characters · Copy link · This is very helpful. Thank you. Copy link · Thanks, i use your first example.
🌐
DataCamp
datacamp.com › tutorial › json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - This function is used to serialize a Python object into a JSON string. The dumps() function takes a single argument, the Python object, and returns a JSON string. Here's an example:
🌐
Power CMS Technology
powercms.in › article › how-get-json-data-remote-url-python-script
How to get json data from remote url into Python script | Power CMS Technology
August 17, 2016 - import urllib, json url = "http://maps.googleapis.com/maps/api/geocode/json?address=googleplex&sensor=false" response = urllib.urlopen(url) data = json.loads(response.read()) print data
🌐
Oxylabs
oxylabs.io › blog › python-parse-json
Reading & Parsing JSON Data With Python: Tutorial
Let’s start with a simple example. The instance of JSON data is as follows: ... 3. Storing JSON string. JSON data can be stored as JSON string before it is parsed. Even though we can use Python’s triple quotes convention to store multi-line strings, we can remove the line breaks for readability.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-parse-json-in-python-with-examples
How to Parse JSON in Python – A Complete Guide With Examples
October 29, 2025 - JSON arrays represent ordered lists of values and appear frequently in API responses when returning collections of items. Python converts JSON arrays into lists, which you can iterate through or access by index. Here's an example parsing a list of products from an inventory system:
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › scenarios › json
JSON — The Hitchhiker's Guide to Python
d = { 'first_name': 'Guido', 'second_name': 'Rossum', 'titles': ['BDFL', 'Developer'], } print(json.dumps(d)) '{"first_name": "Guido", "last_name": "Rossum", "titles": ["BDFL", "Developer"]}'