Monday, October 26, 2015

Python requests and grab values from json response

__author__ = 'valli_000'

import requests

r = requests.get('http://api.fixer.io/latest?base=USD')
data = r.json()
dict = data['rates']
for key,value in dict.iteritems():
    print "US Dollar Conversion of " + str(key) + " is " + str(value)

No comments:

Post a Comment