从Google Places API照片回复中检索网址

时间:2016-11-20 18:43:21

标签: node.js google-places-api facebook-chatbot

我正在使用机器人平台,我必须提供图像URL来显示图像。

Google地方信息图片响应是图片而非网址。有权检索网址吗?

我正在使用NodeJs请求

var options = { method: 'GET',
  url: 'https://maps.googleapis.com/maps/api/place/photo',
  qs: 
  { maxwidth: '400',
    photoreference: photoreference,
    key: Google_Places_KEY },
  };

request(options, function (error, response, body) {
 // Code goes here. 
 });

我现在的解决方案是将照片上传到我的服务器,创建一个URL并提供它。有更好的解决方法吗?

0 个答案:

没有答案