Assuming the actual structure is like this:
{"684x400":
{"949520":
{"_bannerpath": "http://tvdb.com/banners/somepath",
"rating" : 9.000
#etc...
},
"456520":
{"_bannerpath": "http://tvdb.com/banners/somepath",
"rating" : 9.000
#and so on...
}
}
}
Then to find a banner with the highest rating for each resolution:
from operator import itemgetter
for resolution, banners in tvdb_api_result.items():
bannerpath = max(banners.values(), key=itemgetter('rating'))['_bannerpath']
print("%s %s" % (resolution, bannerpath))