dounieqi6959 2015-04-21 14:24
浏览 97
已采纳

获取最近3个Instagram图片发布在一个地方

I've been over the Instagram API for a long time, and couldn't find a way to get the last 3 instagram images posted in a specific place.

For example, a visitor search for "Patrick's Pub". The website will redirect him to the pub's page in my website, and there I will be able to display the last 3 instagram images posted in Patrick's Pub.

Is there any way to display these images? I thought about this URL:

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

But there are 2 problems with this: 1. I can't find a way to convert LAT and LNG coordinates to a place (like the Patrick's bar) 2. If need an access token for this URL, it means the user need to log in to his instagram account, and it will not be suitable for the website, for just vieweing a place instagram photos.

Any help will be appreciated.

  • 写回答

1条回答 默认 最新

  • dongtuoao7987 2015-04-22 16:29
    关注

    Its a 3-step approach:

    1. Instagram uses Facebook Places to tag a photo to places, you have to use facebook graph API to search for actual places at a location and get the facebook_places_id:

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

    1. You then have to make a Instagram location search API call with the facebook_places_id to get the 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. Use the instagram location id to get the recent photos from the place, using the 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


    Here is an implementation of this search: http://www.gramfeed.com/instagram/places
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图