How to load JSON from url using Python?

/ #Python

If you want to get JSON from a website you need to import a few libraries and run a request. Here's how you do it.

# Import libraries
import urllib.request, json 

# Get json from url
with urllib.request.urlopen("") as url:
    # Load JSON
    data = json.loads(

    # Print data


No comments yet...

Add comment


Subscribe to my weekly newsletter. One time per week I will send you a short summary of the tutorials I have posted in the past week.