Where I can find location id of location when using Instagram API

[亡魂溺海] 提交于 2019-12-03 09:38:15

问题


I want to use Instagram API to get a list of recent media objects from a given location. I am using this URL. Now I can't do that, because I don't know where I should take location id?


回答1:


1. First use facebook graph API to search locations and get facebook_places_id. Here is an example:

https://graph.facebook.com/search?q=&type=place&center=37.77493,-122.419415&distance=5000&access_token=ACCESS-TOKEN&expires_in=5184000

2. Get the facebook_places_id and use this instagram location search API to get the corresponding instagram_location_id

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

3. Get the location id and then make the instagram location media API to get recent media:

https://api.instagram.com/v1/locations/514276/media/recent?access_token=ACCESS-TOKEN

Here is an implementation of Instagram location media search using the above method: http://www.gramfeed.com/instagram/places




回答2:


If you can obtain the Latitude and Longitude of the location, you can use the following code to find images from that specific location:

https://api.instagram.com/v1/media/search?lat=48.858844&lng=2.294351&access_token=ACCESS-TOKEN


来源:https://stackoverflow.com/questions/26645645/where-i-can-find-location-id-of-location-when-using-instagram-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!