Hi I'm using Rakuten Web service API to play around with it in Ipython Notebook. I successfully loaded the product ranking data using this url (https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927?format=json&applicationId=1074393356181806125)
My question is that since the Japanese text is unicode, I cannot read the text. How can I handle this?
Here is my code on Ipython Notebook:
import requests
import urllib2
url = 'https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927?format=json&page=1&applicationId=1074393356181806125'
r = requests.get(url)
res = r.json()
res['title']
Current output for title for example:
u'\u3010\u697d\u5929\u5e02\u5834\u3011\u30e9\u30f3\u30ad\u30f3\u30b0\u5e02\u5834 \u3010\u7dcf\u5408\u3011'
When I code print(res['title'])
, I got this error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)