import urllib2,json, base64
accesstoken = "QAWF15SMX1UTC0CA0Y4J"
url = "http://data.unistats.ac.uk/api/v4/KIS/Institutions.json"
#url = "http://data.unistats.ac.uk/api/v4/KIS/Bnstitutions.json"
request = urllib2.Request(url)
request.add_header(
	"Authorization",
	"Basic " + base64.encodestring(accesstoken+":").replace('\n','')
	#"Basic " + base64.encodestring(accesstoken+"").replace('\n','')
	)
response = urllib2.urlopen(request)
data = json.load(response)
for c in data:
	print (c['UKPRN'],c['Name'])