Foursquare 会场图像不显示

Foursquare venue image not displaying

我在 foursquare 中创建了一个应用程序,我有 client_id 和 client_secret 键。我需要所有场地的详细信息。我只能获取场地信息,但无法获取与之链接的图像。 请帮我 。提前致谢

https://api.foursquare.com/v2/venues/40a55d80f964a52020f31ee3?client_id=client_id&client_secret=client_secret&v=20161201

在场馆详细信息响应中,response['photos'] 下有一个照片对象,其中包含一组场馆照片。为了构建照片 url,我们有文档 here

来自文档:

To assemble a resolvable photo URL, take prefix + size + suffix, e.g. https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.

size can be one of the following, where XX or YY is one of 36, 100, 300, or 500.

  • XXxYY
  • original: the original photo's size
  • capXX: cap the photo with a width or height of XX (whichever is larger). Scales the other, smaller dimension proportionally
  • widthXX: forces the width to be XX and scales the height proportionally
  • heightYY: forces the height to be YY and scales the width proportionally

你可以通过这个API获取特定场地的照片 http://api.foursquare.com/v2/venues/VENUE_ID/photos?limit=5&client_id=Client_Id&client_secret=Client_Secret&v=20161107