Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 814
Raul Gonzales Avatar asked Oct 30 '14 05:10

Raul Gonzales


People also ask

Can you share location on Instagram?

Instagram.com from a mobile browserTap Add location. Find your location in the suggestions or search for the location and select it. Tap Share.

Why is Instagram not showing my location?

How do you fix your location on Instagram? If locations aren't appearing when you upload a photo and try to add a location, make sure that you have location enabled for Instagram in your phone's settings. To do this, leave the Instagram app and go to the Location services section of your phone's settings.


1 Answers

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

like image 137
krisrak Avatar answered Sep 21 '22 07:09

krisrak