python api get json code example
Example 1: how to read a json resposnse from a link in python
import urllib, json
url = "put url here"
response = urllib.request.urlopen(url)
data = json.loads(response.read())
print (data)
Example 2: fetch a json from url python
import requests
r = requests.get('url')
print r.json()
Example 3: api in python
import requests
import json
r = requests.get("URL")
j=r.json()
print(j)
Example 4: python api tutorial
response = requests.get("http://api.open-notify.org/iss-now.json")
print(response.status_code)