1

这几乎是一个通用问题,只是希望有人指出我正确的方向。I understand the existence of an API in Alchemy as documented in : http://www.alchemyapi.com/api/image-tagging/urls.html?__hstc=27013730.9b40428638d250ef6490e695d551207d.1458459083806.1458459083806.1458459083806.1&__hssc=27013730.1.1458459083807&__hsfp=2749035364

我设法调用了 API,但无法从数据中找出任何意义。到目前为止,我的代码如下:

import requests

apikey = "01405e7492ca333c6ab3a5c7da544e9f11bf6e26"
picture = open('IMG_1172.JPG','rb').read()
url="http://gateway-a.watsonplatform.net/calls/image/ImageGetRankedImageKeywords?apikey=01405e7492ca333c6ab3a5c7da544e9f11bf6e26&outputMode=json&forceShowAll=1"
r = requests.post(url = url, data = picture)
print r.txt

上面的 r.txt 无法执行,因为它显示响应 200。我想从我的 API 调用中收到一个 json 文件,但我在这里看不到它。

感谢是否有人可以指导我。谢谢 !

4

0 回答 0