This is the code on Python 2 requesting data from an API
results = json.load(urllib.urlopen("https://www.kimonolabs.com/api/ano64pm6?apikey=9ummN7C6KMHu9aErm49ixoy2ZySmaKCm"))
print results
This prints
{u'count': 27,
u'frequency': u'Daily',
u'lastrunstatus': u'success',
u'lastsuccess': u'Fri Feb 27 2015 21:33:02 GMT+0000 (UTC)',
u'name': u'mmoga',
u'newdata': True,
u'nextrun': u'Sat Feb 28 2015 21:33:03 GMT+0000 (UTC)',
u'results': {u'collection1': [{u'price': u'\xa3\xa03.47'},
{u'price': u'\xa3\xa05.20'},
{u'price': u'\xa3\xa06.92'},
{u'price': u'\xa3\xa08.63'},
{u'price': u'\xa3\xa010.34'},
{u'price': u'\xa3\xa012.04'},
{u'price': u'\xa3\xa013.73'},
{u'price': u'\xa3\xa015.42'},
{u'price': u'\xa3\xa017.09'},
{u'price': u'\xa3\xa025.59'},
{u'price': u'\xa3\xa034.05'},
{u'price': u'\xa3\xa042.48'},
{u'price': u'\xa3\xa050.88'},
{u'price': u'\xa3\xa059.23'},
{u'price': u'\xa3\xa067.56'},
{u'price': u'\xa3\xa075.85'},
{u'price': u'\xa3\xa084.11'},
{u'price': u'\xa3\xa0100.73'},
{u'price': u'\xa3\xa0117.27'},
{u'price': u'\xa3\xa0133.75'},
{u'price': u'\xa3\xa0150.17'},
{u'price': u'\xa3\xa0166.51'},
{u'price': u'\xa3\xa0182.79'},
{u'price': u'\xa3\xa0198.99'},
{u'price': u'\xa3\xa0215.13'},
{u'price': u'\xa3\xa0231.20'},
{u'price': u'\xa3\xa0247.28'}]},
u'thisversionrun': u'Fri Feb 27 2015 21:32:48 GMT+0000 (UTC)',
u'thisversionstatus': u'success',
u'version': 3}
I need to call price and get the float next to it. I have tried some pretty simple things so far like,
print requests[price]
and also
print requests[results/collection1/price]
I have no idea how to do this and am new to programming and I cant find any useful tutorials on this so just a point in the right direction would be helpfull