获取在某个地方发布的最后 3 张 instagram 图片

Get last 3 instagram images posted in a place

我在 Instagram API 上浏览了很长时间,但无法找到在特定位置发布的最后 3 张 instagram 图片的方法。

例如,访问者搜索 "Patrick's Pub"。该网站会将他重定向到我网站上的酒吧页面,在那里我将能够显示帕特里克酒吧中发布的最后 3 张 instagram 图片。

有什么方法可以显示这些图片吗?我考虑过这个 URL:

https://api.instagram.com/v1/locations/search?lat=*LAT*&lng=*LNG*&access_token=*THETOKEN*

但这有两个问题: 1. 我找不到将 LATLNG 坐标转换为某个位置(例如帕特里克酒吧)的方法 2. 如果这个URL需要访问令牌,这意味着用户需要登录到他的instagram帐户,并且不适合该网站,仅用于查看某个地方的instagram照片。

任何帮助将不胜感激。

这是一个三步法:

  1. Instagram 使用 Facebook Places 将照片标记为地点,您必须使用 facebook graph API 搜索某个位置的实际地点并获得 facebook_places_id:

https://graph.facebook.com/search?q={NAME}&type=place&center={LAT,LNG}&access_token={ACCESS_TOKEN}&expires_in=5184000

  1. 然后您必须使用 facebook_places_id 进行 Instagram location search API 调用以获取 instagram_location_id:

https://api.instagram.com/v1/locations/search?facebook_places_id={FACEBOOK_PLACES_ID}&access_token={ACCESS-TOKEN}

https://instagram.com/developer/endpoints/locations/#get_locations_search

  1. 使用 instagram location id 从该地点获取最近的照片,使用 Instagram location media API:

https://api.instagram.com/v1/locations/{location-id}/media/recent?access_token={ACCESS-TOKEN}

https://instagram.com/developer/endpoints/locations/#get_locations_media_recent


下面是这个搜索的一个实现:http://www.gramfeed.com/instagram/places